Skip to content

Commit

Permalink
feat(godocfx): include alt documentation link (#3530)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbpg committed Jan 12, 2021
1 parent ab2af0b commit 806cdd5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/godocfx/parse.go
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions internal/godocfx/testdata/golden/index.yml
Expand Up @@ -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
Expand Down

0 comments on commit 806cdd5

Please sign in to comment.