mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-22 20:43:27 +00:00
docs: use nvf injections in docs
This commit is contained in:
parent
5ee7fb1986
commit
43de0c6acb
8 changed files with 64 additions and 13 deletions
|
|
@ -4,6 +4,7 @@
|
|||
stdenvNoCC,
|
||||
optionsJSON,
|
||||
jaq,
|
||||
gnused,
|
||||
} @ args: let
|
||||
manual-release = args.release or "unstable";
|
||||
in
|
||||
|
|
@ -18,6 +19,7 @@ in
|
|||
doCheck = false;
|
||||
})
|
||||
jaq
|
||||
gnused
|
||||
];
|
||||
|
||||
patchPhase = ''
|
||||
|
|
@ -37,6 +39,23 @@ in
|
|||
'';
|
||||
|
||||
buildPhase = ''
|
||||
mkdir -p queries/nix
|
||||
|
||||
# apply nix injections
|
||||
sed -n -f /dev/stdin ${../modules/plugins/languages/nix.nix} <<'EOF' > ./queries/nix/injections.scm
|
||||
/type = "injections"/,/^[[:space:]]*};/ {
|
||||
/query = '''/,/^[[:space:]]*''';/ {
|
||||
/query = '''/d
|
||||
/^[[:space:]]*''';/d
|
||||
p
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
# Syntactica doesnt support `query` so we patch it with the closest it does,
|
||||
# which is `haskell` :bwaa:
|
||||
sed -i 's|#set! injection\.language "query"|#set! injection.language "haskell"|' ./queries/nix/injections.scm
|
||||
|
||||
# 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 \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue