mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-05-17 12:44:03 +00:00
chore: update ndg and fix linkcheck
This commit is contained in:
parent
b80590dd3f
commit
1bff580d63
15 changed files with 69 additions and 130 deletions
|
|
@ -2,43 +2,57 @@
|
|||
inputs,
|
||||
path,
|
||||
stdenvNoCC,
|
||||
runCommandLocal,
|
||||
optionsJSON,
|
||||
release,
|
||||
jaq,
|
||||
} @ args: let
|
||||
manual-release = args.release or "unstable";
|
||||
in
|
||||
runCommandLocal "nvf-docs-html" {
|
||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
pname = "nvf-docs-html";
|
||||
version = manual-release;
|
||||
src = ./manual;
|
||||
|
||||
nativeBuildInputs = [
|
||||
(inputs.ndg.packages.${stdenvNoCC.system}.ndg.overrideAttrs
|
||||
{
|
||||
# FIXME: the tests take too long to build
|
||||
doCheck = false;
|
||||
})
|
||||
(inputs.ndg.packages.${stdenvNoCC.system}.ndg.overrideAttrs {
|
||||
# FIXME: the tests take too long to build
|
||||
doCheck = false;
|
||||
})
|
||||
jaq
|
||||
];
|
||||
} ''
|
||||
mkdir -p $out/share/doc
|
||||
|
||||
# Copy the markdown sources to be processed by ndg. This is not
|
||||
# strictly necessary, but allows us to modify the Markdown sources
|
||||
# as we see fit.
|
||||
cp -rvf ${./manual} ./manual
|
||||
patchPhase = ''
|
||||
# Replace variables following the @VARIABLE@ style in the manual
|
||||
# pages. This can be built into ndg at a later date.
|
||||
substituteInPlace index.md \
|
||||
--subst-var-by NVF_VERSION ${finalAttrs.version}
|
||||
|
||||
# Replace variables following the @VARIABLE@ style in the manual
|
||||
# pages. This can be built into ndg at a later date.
|
||||
substituteInPlace ./manual/index.md \
|
||||
--subst-var-by NVF_VERSION ${manual-release}
|
||||
language_options=$(cat "${optionsJSON}/share/doc/nixos/options.json" | jaq -r 'keys
|
||||
| map(select(test("^vim\\.languages\\.[^.]+\\.enable$")))
|
||||
| map("- {option}`" + . + "`")
|
||||
| join("\n")'
|
||||
)
|
||||
|
||||
# Generate the final manual from a set of parameters. This uses
|
||||
# feel-co/ndg to render the web manual.
|
||||
ndg --config-file ${./ndg.toml} html \
|
||||
--jobs $NIX_BUILD_CORES --title "NVF" \
|
||||
--module-options ${optionsJSON}/share/doc/nixos/options.json \
|
||||
--manpage-urls ${path}/doc/manpage-urls.json \
|
||||
--input-dir ./manual \
|
||||
--output-dir "$out/share/doc"
|
||||
substituteInPlace configuring/languages.md \
|
||||
--subst-var-by NVF_LANGUAGES_ENABLE "$language_options"
|
||||
'';
|
||||
|
||||
# Hydra support. Probably not necessary.
|
||||
mkdir -p $out/nix-support/
|
||||
echo "doc manual $dest index.html" >> $out/nix-support/hydra-build-products
|
||||
''
|
||||
buildPhase = ''
|
||||
# Generate the final manual from a set of parameters. This uses
|
||||
# feel-co/ndg to render the web manual.
|
||||
ndg --config-file ${./ndg.toml} html \
|
||||
--jobs $NIX_BUILD_CORES --title "NVF" \
|
||||
--module-options ${optionsJSON}/share/doc/nixos/options.json \
|
||||
--manpage-urls ${path}/doc/manpage-urls.json \
|
||||
--input-dir . \
|
||||
--output-dir build
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/doc
|
||||
cp -r build/* $out/share/doc/
|
||||
|
||||
# Hydra support. Probably not necessary.
|
||||
mkdir -p $out/nix-support/
|
||||
echo "doc manual $out/share/doc index.html" >> $out/nix-support/hydra-build-products
|
||||
'';
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue