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

vdoc: highlight inline examples for -f html (#13879)

This commit is contained in:
Nick Treleaven
2022-03-31 17:32:32 +01:00
committed by GitHub
parent 5c43493183
commit a87cd9663e
6 changed files with 9 additions and 9 deletions

View File

@ -430,8 +430,8 @@ fn doc_node_html(dn doc.DocNode, link string, head bool, include_examples bool,
example_title := if examples.len > 1 { 'Examples' } else { 'Example' }
dnw.writeln('<section class="doc-node examples"><h4>$example_title</h4>')
for example in examples {
// hl_example := html_highlight(example, tb)
dnw.writeln('<pre><code class="language-v">$example</code></pre>')
hl_example := html_highlight(example, tb)
dnw.writeln('<pre><code class="language-v">$hl_example</code></pre>')
}
dnw.writeln('</section>')
}