docs: Introduce an user guide (#1121)

This commit is contained in:
traxys 2024-02-18 15:56:18 +01:00 committed by GitHub
parent d656834e3d
commit ad8aa72490
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 117 additions and 6 deletions

View file

@ -5,7 +5,7 @@
nixos-render-docs,
pandoc,
}: let
capitalizeHeaders = ''
manualFilter = ''
local text = pandoc.text
function Header(el)
@ -17,17 +17,24 @@
}
end
end
function Link(el)
return el.content
end
'';
manHeader =
manHeader = let
mkMDSection = file: "<(pandoc --lua-filter <(echo \"$manualFilter\") -f gfm -t man ${file})";
in
runCommand "nixvim-general-doc-manpage" {
nativeBuildInputs = [pandoc];
inherit capitalizeHeaders;
inherit manualFilter;
} ''
mkdir -p $out
cat \
${./nixvim-header-start.5} \
<(pandoc --lua-filter <(echo "$capitalizeHeaders") -f gfm -t man ${../helpers.md}) \
${mkMDSection ../user-guide/helpers.md} \
${mkMDSection ../user-guide/faq.md} \
${./nixvim-header-end.5} \
>$out/nixvim-header.5
'';