1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2024-12-14 11:57:55 +00: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 b006bf1d74
commit 0a71046493
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 \