mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-03 01:25:22 +02:00
docs: Add a short sections on helpers (#1093)
This commit is contained in:
parent
28d4d2a842
commit
375453feff
6 changed files with 86 additions and 17 deletions
|
@ -3,17 +3,45 @@
|
|||
runCommand,
|
||||
installShellFiles,
|
||||
nixos-render-docs,
|
||||
}:
|
||||
runCommand "nixvim-configuration-reference-manpage" {
|
||||
nativeBuildInputs = [installShellFiles nixos-render-docs];
|
||||
} ''
|
||||
# Generate man-pages
|
||||
mkdir -p $out/share/man/man5
|
||||
nixos-render-docs -j $NIX_BUILD_CORES options manpage \
|
||||
--revision unstable \
|
||||
--header ${./nixvim-header.5} \
|
||||
--footer ${./nixvim-footer.5} \
|
||||
${options-json}/share/doc/nixos/options.json \
|
||||
$out/share/man/man5/nixvim.5
|
||||
compressManPages $out
|
||||
''
|
||||
pandoc,
|
||||
}: let
|
||||
capitalizeHeaders = ''
|
||||
local text = pandoc.text
|
||||
|
||||
function Header(el)
|
||||
if el.level == 1 then
|
||||
return el:walk {
|
||||
Str = function(el)
|
||||
return pandoc.Str(text.upper(el.text))
|
||||
end
|
||||
}
|
||||
end
|
||||
end
|
||||
'';
|
||||
|
||||
manHeader =
|
||||
runCommand "nixvim-general-doc-manpage" {
|
||||
nativeBuildInputs = [pandoc];
|
||||
inherit capitalizeHeaders;
|
||||
} ''
|
||||
mkdir -p $out
|
||||
cat \
|
||||
${./nixvim-header-start.5} \
|
||||
<(pandoc --lua-filter <(echo "$capitalizeHeaders") -f gfm -t man ${../helpers.md}) \
|
||||
${./nixvim-header-end.5} \
|
||||
>$out/nixvim-header.5
|
||||
'';
|
||||
in
|
||||
runCommand "nixvim-configuration-reference-manpage" {
|
||||
nativeBuildInputs = [installShellFiles nixos-render-docs];
|
||||
} ''
|
||||
# Generate man-pages
|
||||
mkdir -p $out/share/man/man5
|
||||
nixos-render-docs -j $NIX_BUILD_CORES options manpage \
|
||||
--revision unstable \
|
||||
--header ${manHeader}/nixvim-header.5 \
|
||||
--footer ${./nixvim-footer.5} \
|
||||
${options-json}/share/doc/nixos/options.json \
|
||||
$out/share/man/man5/nixvim.5
|
||||
compressManPages $out
|
||||
''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue