Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(godocfx): include alt documentation link #3530

Merged
merged 1 commit into from Jan 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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