Skip to content
Permalink
Browse files
feat(godocfx): include alt documentation link (#3530)
  • Loading branch information
tbpg committed Jan 12, 2021
1 parent ab2af0b commit 806cdd56fb6fdddd7a6c1354e55e0d1259bd6c8b
Showing with 3 additions and 0 deletions.
  1. +2 −0 internal/godocfx/parse.go
  2. +1 −0 internal/godocfx/testdata/golden/index.yml
@@ -83,6 +83,7 @@ type item struct {
Syntax syntax `yaml:"syntax,omitempty"`
Examples []example `yaml:"codeexamples,omitempty"`
Children []child `yaml:"children,omitempty"`
AltLink string `yaml:"alt_link,omitempty"`
}

func (p *page) addItem(i *item) {
@@ -156,6 +157,7 @@ func parse(glob string, workingDir string, optionalExtraFiles []string) (*result
Langs: onlyGo,
Type: "package",
Examples: processExamples(pi.doc.Examples, pi.fset),
AltLink: "https://pkg.go.dev/" + pi.doc.ImportPath,
}
pkgPage := &page{Items: []*item{pkgItem}}
pages[pi.doc.ImportPath] = pkgPage
@@ -231,6 +231,7 @@ items:
- cloud.google.com/go/storage.Writer.CloseWithError
- cloud.google.com/go/storage.Writer.Write
- cloud.google.com/go/storage.SignedURL
alt_link: https://pkg.go.dev/cloud.google.com/go/storage
- uid: cloud.google.com/go/storage.DeleteAction,SetStorageClassAction
name: DeleteAction, SetStorageClassAction
id: DeleteAction,SetStorageClassAction

0 comments on commit 806cdd5

Please sign in to comment.