diff --git a/cmd/tools/vdoc/html.v b/cmd/tools/vdoc/html.v index 574e13b52a..3e96338ad4 100644 --- a/cmd/tools/vdoc/html.v +++ b/cmd/tools/vdoc/html.v @@ -12,9 +12,13 @@ import v.doc import v.pref const ( - css_js_assets = ['doc.css', 'normalize.css', 'doc.js', 'dark-mode.js'] - default_theme = os.resource_abs_path('theme') - link_svg = '' + css_js_assets = ['doc.css', 'normalize.css', 'doc.js', 'dark-mode.js'] + default_theme = os.resource_abs_path('theme') + link_svg = '' + + single_quote = "'" + double_quote = '"' + no_quotes_replacement = [single_quote, '', double_quote, ''] ) enum HighlightTokenTyp { @@ -385,8 +389,9 @@ fn doc_node_html(dn doc.DocNode, link string, head bool, include_examples bool, highlighted_code := html_highlight(dn.content, tb) node_class := if dn.kind == .const_group { ' const' } else { '' } sym_name := get_sym_name(dn) - has_deprecated := 'deprecated' in dn.tags - mut tags := dn.tags.filter(it != 'deprecated') + mut deprecated_tags := dn.tags.filter(it.starts_with('deprecated')) + deprecated_tags.sort() + mut tags := dn.tags.filter(!it.starts_with('deprecated')) tags.sort() mut node_id := get_node_id(dn) mut hash_link := if !head { ' #' } else { '' } @@ -406,13 +411,12 @@ fn doc_node_html(dn doc.DocNode, link string, head bool, include_examples bool, } dnw.write_string('') } - if tags.len > 0 || has_deprecated { - mut attributes := if has_deprecated { - '