1
0
Fork 0
mirror of https://github.com/NotAShelf/neovim-flake.git synced 2024-12-25 14:59:48 +01:00
neovim-flake/docs/manual.nix
Gerg-L 57be605ed4
lib.neovimConfiguration: deprecated extraModules and configuration ()
* lib.neovimConfiguration: deprecated extraModules and configuration

* docs: various fixes
2024-09-22 22:52:10 +03:00

63 lines
1.6 KiB
Nix

{
lib,
stdenvNoCC,
# build inputs
nixos-render-docs,
documentation-highlighter,
path,
# nrd configuration
release,
optionsJSON,
}:
stdenvNoCC.mkDerivation {
name = "nvf-manual";
src = builtins.path {
path = lib.sourceFilesBySuffices ./manual [".md"];
name = "nvf-manual";
};
nativeBuildInputs = [nixos-render-docs];
buildPhase = ''
dest="$out/share/doc/nvf"
mkdir -p "$(dirname "$dest")"
mkdir -p $dest/{highlightjs,media}
cp -vt $dest/highlightjs \
${documentation-highlighter}/highlight.pack.js \
${documentation-highlighter}/LICENSE \
${documentation-highlighter}/mono-blue.css \
${documentation-highlighter}/loader.js
substituteInPlace ./options.md \
--subst-var-by \
OPTIONS_JSON \
${optionsJSON}/share/doc/nixos/options.json
substituteInPlace ./manual.md \
--subst-var-by \
NVF_VERSION \
${release}
# copy stylesheet
cp ${./static/style.css} "$dest/style.css"
# copy release notes
cp -vr ${./release-notes} release-notes
# generate manual from
nixos-render-docs manual html \
--manpage-urls ${path + "/doc/manpage-urls.json"} \
--revision ${lib.trivial.revisionWithDefault release} \
--stylesheet style.css \
--script highlightjs/highlight.pack.js \
--script highlightjs/loader.js \
--toc-depth 2 \
--section-toc-depth 1 \
manual.md \
"$dest/index.xhtml"
mkdir -p $out/nix-support/
echo "doc manual $dest index.html" >> $out/nix-support/hydra-build-products
'';
}