aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-02-24 17:54:48 +0100
committerGitHub <noreply@github.com>2022-02-24 17:54:48 +0100
commit3317866060bfb88e0113b5d6275d1ad0e3f74d8d (patch)
tree2b7d19a26675f46f0308735b9416f07a2d4dce5e
parent7ec244aec2d3ebe36b7495a2321a05f02f0b4186 (diff)
parentcfbf9ee2ce35b64ced1822c132bd46bd4fd848b2 (diff)
Merge pull request #6150 from GuillaumeDesforges/doc/builtins-function-anchor
Add anchor to builtin functions in HTML documentation
-rw-r--r--doc/manual/generate-builtins.nix4
-rw-r--r--doc/manual/local.mk1
2 files changed, 3 insertions, 2 deletions
diff --git a/doc/manual/generate-builtins.nix b/doc/manual/generate-builtins.nix
index 92c7b1a31..6c8b88da2 100644
--- a/doc/manual/generate-builtins.nix
+++ b/doc/manual/generate-builtins.nix
@@ -6,9 +6,9 @@ builtins:
concatStrings (map
(name:
let builtin = builtins.${name}; in
- "<dt><code>${name} "
+ "<dt id=\"builtins-${name}\"><a href=\"#builtins-${name}\"><code>${name} "
+ concatStringsSep " " (map (s: "<var>${s}</var>") builtin.args)
- + "</code></dt>"
+ + "</code></a></dt>"
+ "<dd>\n\n"
+ builtin.doc
+ "\n\n</dd>"
diff --git a/doc/manual/local.mk b/doc/manual/local.mk
index 6b232a736..c1ce8aaeb 100644
--- a/doc/manual/local.mk
+++ b/doc/manual/local.mk
@@ -72,6 +72,7 @@ $(d)/builtins.json: $(bindir)/nix
@mv $@.tmp $@
# Generate the HTML manual.
+html: $(docdir)/manual/index.html
install: $(docdir)/manual/index.html
# Generate 'nix' manpages.