docs: Generate manpages from docs, use in CLI
Change-Id: I6a6a69646c6ff4c4b70cb928dc1df06890144429
This commit is contained in:
parent
5332df82bb
commit
30814de5e4
4 changed files with 26 additions and 45 deletions
13
docs/manpages.nix
Normal file
13
docs/manpages.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ pkgs, asciidoctor, groff, ... }: let
|
||||
generateManpage = name: file: pkgs.runCommandNoCC name {} ''
|
||||
${asciidoctor}/bin/asciidoctor -b manpage -o $out ${file}
|
||||
'';
|
||||
textifyManpage = name: manpage: pkgs.runCommandNoCC name {} ''
|
||||
${groff}/bin/groff -t -e -mandoc -Tascii ${manpage} > $out
|
||||
'';
|
||||
|
||||
generateBoth = name: file: rec { man = generateManpage name file; txt = textifyManpage "${name}.txt" man; };
|
||||
in {
|
||||
rust = generateBoth "zilch-cli-rust.1" ./modules/ROOT/pages/rust/man.adoc;
|
||||
go = generateBoth "zilch-cli-go.1" ./modules/ROOT/pages/go/man.adoc;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue