Skip to content

Commit

Permalink
doc: fix duplication in toc (#19726)
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldaeschle committed Nov 2, 2023
1 parent 8f05b0f commit 1e80e47
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/tools/vdoc/html.v
Expand Up @@ -210,13 +210,14 @@ fn (vd VDoc) gen_html(d doc.Doc) string {
}
// write nav1
if cfg.is_multi || vd.docs.len > 1 {
mut submod_prefix := ''
mut used_submod_prefix := []string{}
for i, dc in vd.docs {
if i - 1 >= 0 && dc.head.name.starts_with(submod_prefix + '.') {
names := dc.head.name.split('.')
submod_prefix := if names.len > 1 { names[0] } else { dc.head.name }
if i - 1 >= 0 && submod_prefix in used_submod_prefix {
continue
}
names := dc.head.name.split('.')
submod_prefix = if names.len > 1 { names[0] } else { dc.head.name }
used_submod_prefix << submod_prefix
mut href_name := './${dc.head.name}.html'
if (cfg.is_vlib && dc.head.name == 'builtin' && !cfg.include_readme)
|| dc.head.name == 'README' {
Expand Down

0 comments on commit 1e80e47

Please sign in to comment.