1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-05 18:59:44 +01:00

docs: fix syntax highlighting

`document-highlighter` now outputs a `<code>` block inside the
pre-formatted `<pre>` tag. This changes the required CSS for
rendering code snippets. Moreover, this commit uses the highlightjs
as provided by the `document-highlighter` package instead of the
version packaged in `nmd`.
This commit is contained in:
Viktor Kronvall 2023-12-02 09:30:14 +09:00
parent ecc724dac9
commit 0da5767319
2 changed files with 14 additions and 3 deletions

8
docs/highlight-style.css Normal file
View file

@ -0,0 +1,8 @@
pre {
padding: 0;
}
pre code.hljs {
border: none;
margin: 0;
}

View file

@ -32,14 +32,17 @@ in stdenv.mkDerivation {
--replace \
'@OPTIONS_JSON@' \
${home-manager-options.nix-darwin}/share/doc/nixos/options.json
cp -t out/highlightjs ${nmd}/static/highlightjs/tomorrow-night.min.css
cp ${./highlight-style.css} out/highlightjs/highlight-style.css
nixos-render-docs manual html \
--manpage-urls ./manpage-urls.json \
--revision ${lib.trivial.revisionWithDefault revision} \
--stylesheet ${nmd}/static/style.css \
--stylesheet ${nmd}/static/highlightjs/tomorrow-night.min.css \
--script ${nmd}/static/highlightjs/highlight.min.js \
--script ${nmd}/static/highlightjs/highlight.load.js \
--stylesheet $out/share/doc/home-manager/highlightjs/tomorrow-night.min.css \
--stylesheet $out/share/doc/home-manager/highlightjs/highlight-style.css \
--script $out/share/doc/home-manager/highlightjs/highlight.pack.js \
--script $out/share/doc/home-manager/highlightjs/loader.js \
--toc-depth 1 \
--section-toc-depth 1 \
manual.md \