diff options
author | Valentin Gagarin <valentin.gagarin@tweag.io> | 2022-08-26 17:08:20 +0200 |
---|---|---|
committer | Valentin Gagarin <valentin.gagarin@tweag.io> | 2022-09-30 01:42:46 +0200 |
commit | 6b56bb4a79a3aa20160c21ec7e5e17e9c4b2b6c3 (patch) | |
tree | 0cf89c57cbe90b3c0194f2b56e288c2265b6b9e2 /doc/manual/generate-manpage.nix | |
parent | 82ef3c470be7e2be2f104317986ed9a8e25f23ef (diff) |
use indented strings where appropriate
Diffstat (limited to 'doc/manual/generate-manpage.nix')
-rw-r--r-- | doc/manual/generate-manpage.nix | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/doc/manual/generate-manpage.nix b/doc/manual/generate-manpage.nix index 17701c3a3..7b1ca8c11 100644 --- a/doc/manual/generate-manpage.nix +++ b/doc/manual/generate-manpage.nix @@ -8,12 +8,18 @@ let showCommand = { command, def, filename }: '' - **Warning**: This program is **experimental** and its interface is subject to change. + > **Warning** + > This program is **experimental** and its interface is subject to change. + + # Name + + `${command}` - ${def.description} + + # Synopsis + + ${showSynopsis { inherit command; args = def.args; }} + '' - + "# Name\n\n" - + "`${command}` - ${def.description}\n\n" - + "# Synopsis\n\n" - + showSynopsis { inherit command; args = def.args; } + (if def.commands or {} != {} then let @@ -24,8 +30,10 @@ let + "[`${command} ${name}`](./${appendName filename name}.md)" + " - ${cmds.${name}.description}\n") (attrNames cmds)); - in - "where *subcommand* is one of the following:\n\n" + in '' + where *subcommand* is one of the following: + + '' # FIXME: group by category + (if length categories > 1 then @@ -76,7 +84,7 @@ let showSynopsis = { command, args }: "`${command}` [*option*...] ${concatStringsSep " " - (map (arg: "*${arg.label}*" + (if arg ? arity then "" else "...")) args)}\n\n"; + (map (arg: "*${arg.label}*" + (if arg ? arity then "" else "...")) args)}"; processCommand = { command, def, filename }: [ { name = filename + ".md"; value = showCommand { inherit command def filename; }; inherit command; } ] |