aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-08-20 12:21:46 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-08-20 12:21:46 +0200
commitdc2f278c95ce4a73749cbb8221a568201535d46a (patch)
tree9e4a754396d63b731ed7e5ccfb7e572547d06e1a /doc
parent3c4f8c91759ac5ed6a211f8e72b9d4e8438db833 (diff)
Allow 'nix' subcommands to provide docs in Markdown format
Diffstat (limited to 'doc')
-rw-r--r--doc/manual/generate-manpage.jq6
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/manual/generate-manpage.jq b/doc/manual/generate-manpage.jq
index d3cf1c601..dd632f162 100644
--- a/doc/manual/generate-manpage.jq
+++ b/doc/manual/generate-manpage.jq
@@ -12,7 +12,7 @@ def show_flags:
;
def show_synopsis:
- "`" + .command + "` " + (.args | map("*" + .label + "*" + (if has("arity") then "" else "..." end)) | join(" ")) + "\n\n"
+ "`" + .command + "` [*flags*...] " + (.args | map("*" + .label + "*" + (if has("arity") then "" else "..." end)) | join(" ")) + "\n\n"
;
def show_command:
@@ -21,6 +21,10 @@ def show_command:
+ "`" + .command + "` - " + .def.description + "\n\n"
+ .section + " Synopsis\n\n"
+ ({"command": .command, "args": .def.args} | show_synopsis)
+ + (if .def | has("doc")
+ then .section + " Description\n\n" + .def.doc + "\n\n"
+ else ""
+ end)
+ (if (.def.flags | length) > 0 then
.section + " Flags\n\n"
+ (.def | show_flags)