diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-12-02 23:19:16 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-12-02 23:23:23 +0100 |
commit | e2efc63979a5485a96accaa1e49ffec65c353078 (patch) | |
tree | 671343782c35eec897e279cc55c85b49f0f14900 /doc/manual/generate-manpage.nix | |
parent | 72428e38d904a1db746f37c8727ab7b0fbb457bc (diff) |
Put examples first in the manpages
Diffstat (limited to 'doc/manual/generate-manpage.nix')
-rw-r--r-- | doc/manual/generate-manpage.nix | 11 |
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; |