Skip to content

Commit 901aa83

Browse files
author
Lukas Neubert
authored
vdoc: hide README toc entry without readme (#8841)
1 parent 329e393 commit 901aa83

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmd/tools/vdoc/html.v

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,9 @@ fn write_toc(dn doc.DocNode, mut toc strings.Builder) {
515515
}
516516
}
517517
if is_module_readme(dn) {
518+
if dn.comments.len == 0 || (dn.comments.len > 0 && dn.comments[0].text.len == 0) {
519+
return
520+
}
518521
toc.write('<li class="open"><a href="#readme_$toc_slug">README</a>')
519522
} else if dn.name != 'Constants' {
520523
toc.write('<li class="open"><a href="#$toc_slug">$dn.kind $dn.name</a>')

0 commit comments

Comments
 (0)