1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 18:01:16 +02:00

Make doc() return arbitrary Markdown rather than the contents of the "Description" section

Thus we can return the examples section (and any other sections) from
doc() and don't need examples() anymore.
This commit is contained in:
Eelco Dolstra 2020-12-03 13:55:19 +01:00
parent 0bd060f23a
commit c3c858ac6d
2 changed files with 21 additions and 7 deletions

View file

@ -26,7 +26,7 @@ let
+ 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"
then def.doc + "\n\n"
else "")
+ (let s = showFlags def.flags; in
if s != ""