mirror of
https://github.com/NixOS/nix
synced 2025-07-07 14:21:48 +02:00
Generate builtins section of the manual
This commit is contained in:
parent
a990f063ff
commit
0f314f3c25
5 changed files with 36 additions and 3 deletions
6
doc/manual/generate-builtins.jq
Normal file
6
doc/manual/generate-builtins.jq
Normal file
|
@ -0,0 +1,6 @@
|
|||
. | to_entries | sort_by(.key) | map(
|
||||
" - `builtins." + .key + "` "
|
||||
+ (.value.args | map("*" + . + "*") | join(" "))
|
||||
+ " \n\n"
|
||||
+ (.value.doc | split("\n") | map(" " + . + "\n") | join("")) + "\n\n"
|
||||
) | join("")
|
|
@ -32,15 +32,22 @@ $(d)/src/command-ref/conf-file.md: $(d)/conf-file.json $(d)/generate-options.jq
|
|||
jq -r -f doc/manual/generate-options.jq $< >> $@
|
||||
|
||||
$(d)/nix.json: $(bindir)/nix
|
||||
$(trace-gen) $(bindir)/nix dump-args > $@
|
||||
$(trace-gen) $(bindir)/nix __dump-args > $@
|
||||
|
||||
$(d)/conf-file.json: $(bindir)/nix
|
||||
$(trace-gen) env -i NIX_CONF_DIR=/dummy HOME=/dummy $(bindir)/nix show-config --json --experimental-features nix-command > $@
|
||||
|
||||
$(d)/src/expressions/builtins.md: $(d)/builtins.json $(d)/generate-builtins.jq $(d)/src/expressions/builtins-prefix.md
|
||||
cat doc/manual/src/expressions/builtins-prefix.md > $@
|
||||
jq -r -f doc/manual/generate-builtins.jq $< >> $@
|
||||
|
||||
$(d)/builtins.json: $(bindir)/nix
|
||||
$(trace-gen) $(bindir)/nix __dump-builtins > $@
|
||||
|
||||
# Generate the HTML manual.
|
||||
install: $(docdir)/manual/index.html
|
||||
|
||||
$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/custom.css
|
||||
$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/custom.css $(d)/src/command-ref/nix.md $(d)/src/command-ref/conf-file.md $(d)/src/expressions/builtins.md
|
||||
$(trace-gen) mdbook build doc/manual -d $(docdir)/manual
|
||||
@cp doc/manual/highlight.pack.js $(docdir)/manual/highlight.js
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue