aboutsummaryrefslogtreecommitdiff
path: root/doc/manual
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-12-02 23:19:16 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-12-02 23:23:23 +0100
commite2efc63979a5485a96accaa1e49ffec65c353078 (patch)
tree671343782c35eec897e279cc55c85b49f0f14900 /doc/manual
parent72428e38d904a1db746f37c8727ab7b0fbb457bc (diff)
Put examples first in the manpages
Diffstat (limited to 'doc/manual')
-rw-r--r--doc/manual/generate-manpage.nix11
1 files changed, 6 insertions, 5 deletions
diff --git a/doc/manual/generate-manpage.nix b/doc/manual/generate-manpage.nix
index 2801e96fa..4a0b0290b 100644
--- a/doc/manual/generate-manpage.nix
+++ b/doc/manual/generate-manpage.nix
@@ -20,6 +20,11 @@ let
(attrNames def.commands))
+ "\n"
else "")
+ + (if def.examples or [] != []
+ then
+ "# Examples\n\n"
+ + concatStrings (map ({ description, command }: "${description}\n\n```console\n${command}\n```\n\n") def.examples)
+ else "")
+ (if def ? doc
then "# Description\n\n" + def.doc + "\n\n"
else "")
@@ -27,11 +32,7 @@ let
if s != ""
then "# Flags\n\n${s}"
else "")
- + (if def.examples or [] != []
- then
- "# Examples\n\n"
- + concatStrings (map ({ description, command }: "${description}\n\n```console\n${command}\n```\n\n") def.examples)
- else "");
+ ;
appendName = filename: name: (if filename == "nix" then "nix3" else filename) + "-" + name;