mirror of
https://github.com/vlang/v.git
synced 2025-09-08 23:07:19 -04:00
doc: fix duplication in toc (#19726)
This commit is contained in:
parent
8f05b0feea
commit
1e80e47b79
@ -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' {
|
||||
|
Loading…
x
Reference in New Issue
Block a user