vdoc: fix markdown toc link rendering (#8714)

pull/8719/head
Ned Palacios 2021-02-13 15:04:47 +08:00 committed by GitHub
parent db609a0784
commit ebb5305b27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ fn (vd VDoc) gen_markdown(d doc.Doc, with_toc bool) string {
fn (vd VDoc) write_markdown_content(contents []doc.DocNode, mut cw strings.Builder, mut hw strings.Builder, indent int, with_toc bool) {
for cn in contents {
if with_toc && cn.name.len > 0 {
hw.writeln(' '.repeat(2 * indent) + '- [#$cn.name](${slug(cn.name)})')
hw.writeln(' '.repeat(2 * indent) + '- [${slug(cn.name)}](#$cn.name)')
cw.writeln('## $cn.name')
}
if cn.content.len > 0 {

View File

@ -366,8 +366,8 @@ fn (mut vd VDoc) generate_docs_from_file() {
vd.render_static_html(out)
}
vd.render_parallel(out)
println('Creating search index...')
if out.typ == .html {
println('Creating search index...')
vd.collect_search_index(out)
vd.render_search_index(out)
// move favicons to target directory