Added manpages to the generated documentation
This commit is contained in:
parent
ba6377b375
commit
4472d74e96
5 changed files with 49 additions and 0 deletions
|
|
@ -6,6 +6,8 @@
|
|||
}:
|
||||
|
||||
let
|
||||
man = pkgs.callPackage ./man { inherit self; };
|
||||
|
||||
baseModule = _: {
|
||||
# Hide documentation relating to _module.args, which isn't a part
|
||||
# of this flake
|
||||
|
|
@ -35,6 +37,8 @@ let
|
|||
commonMark = docs.optionsCommonMark;
|
||||
json = docs.optionsJSON;
|
||||
nix = docs.optionsNix;
|
||||
|
||||
man = man.build "modules" subcomponent docs.optionsJSON;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
|
|||
30
docs/man/default.nix
Normal file
30
docs/man/default.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ pkgs, self, ... }:
|
||||
{
|
||||
build = type: subcomponent: json:
|
||||
pkgs.runCommand "hylonix-${subcomponent}-manpage"
|
||||
{
|
||||
header = ./header.5;
|
||||
footer = ./footer.5;
|
||||
inherit type subcomponent json;
|
||||
revision = self.lastModifiedDate;
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkgs.buildPackages.installShellFiles
|
||||
pkgs.nixos-render-docs
|
||||
];
|
||||
allowedReferences = [ "out" ];
|
||||
}
|
||||
''
|
||||
substitute "$header" ./header \
|
||||
--subst-var subcomponent \
|
||||
--subst-var type
|
||||
|
||||
nixos-render-docs -j $NIX_BUILD_CORES options manpage \
|
||||
--revision "$revision" \
|
||||
--header ./header \
|
||||
--footer "$footer" \
|
||||
"$json/share/doc/nixos/options.json" \
|
||||
"hylonix-$subcomponent.5"
|
||||
installManPage hylonix-*.5
|
||||
'';
|
||||
}
|
||||
3
docs/man/footer.5
Normal file
3
docs/man/footer.5
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
.SH "AUTHORS"
|
||||
.PP
|
||||
hylodon
|
||||
11
docs/man/header.5
Normal file
11
docs/man/header.5
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
.TH "HYLONIX" "5" "01/01/1970" "hylonix"
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
.ad l
|
||||
.\" enable line breaks after slashes
|
||||
.cflags 4 /
|
||||
.SH "NAME"
|
||||
\fIhylonix-@subcomponent@\fP \- @type@ from the hylonix flake
|
||||
.SH "OPTIONS"
|
||||
.PP
|
||||
Loading…
Add table
Add a link
Reference in a new issue