Skip to content

Commit

Permalink
fix(internal/godocfx): add TOC element for module root package (#3599)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbpg authored Jan 22, 2021
1 parent ae96dcb commit 1d6eb23
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/godocfx/parse.go
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit 1d6eb23

Please sign in to comment.