zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit c0da41582bb04db318c9698a1a9ea51247610b36 (tree)
parent c3a8f1fe9268b2b24ae49a2d3490210a3a221dac
Author: Loris Cro <kappaloris@gmail.com>
Date:   Sun,  3 Sep 2023 17:11:54 +0200

autodoc: better light mode colors

fix #15799

Diffstat:
Mlib/docs/index.html | 12+++++++++---
Mlib/docs/main.js | 8+++++---
2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/lib/docs/index.html b/lib/docs/index.html @@ -818,7 +818,8 @@ pre { --zig-keyword: #333; --zig-builtin: #0086b3; - --zig-identifier: 'black'; + --zig-identifier: black; + --zig-decl-identifier: #0086b3; --zig-string-literal: #d14; --zig-type: #458; --zig-fn: #900; @@ -828,13 +829,13 @@ pre { --zig-keyword: #eee; --zig-builtin: #ff894c; - --zig-identifier: 'purple'; + --zig-identifier: #bbbbbb; + --zig-decl-identifier: lightblue; --zig-string-literal: #2e5; --zig-type: #68f; --zig-fn: #e33; } } - .zig_keyword_addrspace, .zig_keyword_align, @@ -914,6 +915,11 @@ color: var(--zig-identifier); font-weight: bold; } + + .zig_decl_identifier { + color: var(--zig-decl-identifier); + font-weight: bold; + } .zig_number_literal, .zig_special { diff --git a/lib/docs/main.js b/lib/docs/main.js @@ -1269,12 +1269,14 @@ Happy writing! result = `<span class="zig_special">${src}</span>`; } else if (t.tag == Tag.identifier && t.fnDecl) { result = `<span class="zig_fn">${src}</span>`; + } else if (t.tag == Tag.identifier && t.isDecl) { + result = `<span class="zig_decl_identifier">${src}</span>`; } else { result = `<span class="zig_${t.tag}">${src}</span>`; } if (t.link) { - result = `<a href="${t.link}">` + result + "</a>"; + result = `<a class="zighref="${t.link}">` + result + "</a>"; } return result; @@ -1316,9 +1318,9 @@ Happy writing! const name = getDecl(expr.declRef).name; const link = declLinkOrSrcLink(expr.declRef); if (link) { - yield { src: name, tag: Tag.identifier, link }; + yield { src: name, tag: Tag.identifier, isDecl: true, link }; } else { - yield { src: name, tag: Tag.identifier }; + yield { src: name, tag: Tag.identifier, isDecl: true }; } return; }