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

fix(internal/godocfx): add TOC element for module root package #3599

Merged
merged 2 commits into from Jan 22, 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
9 changes: 8 additions & 1 deletion internal/godocfx/parse.go
Expand Up @@ -339,9 +339,16 @@ func buildTOC(mod string, pis []pkgInfo, extraFiles []extraFile) tableOfContents
toc := tableOfContents{}

modTOC := &tocItem{
UID: mod, // Assume the module root has a package.
UID: mod,
Name: mod,
}

// Assume the module root has a package.
modTOC.addItem(&tocItem{
UID: mod,
Name: mod,
})

for _, ef := range extraFiles {
modTOC.addItem(&tocItem{
Href: ef.dstRelativePath,
Expand Down
2 changes: 2 additions & 0 deletions internal/godocfx/testdata/golden/toc.yml
Expand Up @@ -2,5 +2,7 @@
- uid: cloud.google.com/go/storage
name: cloud.google.com/go/storage
items:
- uid: cloud.google.com/go/storage
name: cloud.google.com/go/storage
- name: README
href: pkg-readme.md