1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vdoc: hide README toc entry without readme (#8841)

This commit is contained in:
Lukas Neubert 2021-02-20 15:03:10 +01:00 committed by GitHub
parent 329e3938d9
commit 901aa83e65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -515,6 +515,9 @@ fn write_toc(dn doc.DocNode, mut toc strings.Builder) {
}
}
if is_module_readme(dn) {
if dn.comments.len == 0 || (dn.comments.len > 0 && dn.comments[0].text.len == 0) {
return
}
toc.write('<li class="open"><a href="#readme_$toc_slug">README</a>')
} else if dn.name != 'Constants' {
toc.write('<li class="open"><a href="#$toc_slug">$dn.kind $dn.name</a>')