docs: include manpages

This commit is contained in:
NotAShelf 2023-12-09 22:21:36 +03:00
parent e360a1c16c
commit 78f21b75b7
No known key found for this signature in database
GPG key ID: 02D1DD3FA08B6B29
4 changed files with 55 additions and 9 deletions

View file

@ -39,7 +39,7 @@
name = "<${repo}/${subpath}>"; name = "<${repo}/${subpath}>";
}; };
hmPath = toString ./..; nvimPath = toString ./..;
buildOptionsDocs = args @ { buildOptionsDocs = args @ {
modules, modules,
@ -59,10 +59,10 @@
# Clean up declaration sites to not refer to the Home Manager # Clean up declaration sites to not refer to the Home Manager
# source tree. # source tree.
declarations = map (decl: declarations = map (decl:
if lib.hasPrefix hmPath (toString decl) if lib.hasPrefix nvimPath (toString decl)
then then
githubDeclaration "notashelf" "neovim-flake" githubDeclaration "notashelf" "neovim-flake"
(lib.removePrefix "/" (lib.removePrefix hmPath (toString decl))) (lib.removePrefix "/" (lib.removePrefix nvimPath (toString decl)))
else if decl == "lib/modules.nix" else if decl == "lib/modules.nix"
then then
# TODO: handle this in a better way (may require upstream # TODO: handle this in a better way (may require upstream
@ -97,11 +97,11 @@
mkdir -p $out/share/man/man1 mkdir -p $out/share/man/man1
nixos-render-docs -j $NIX_BUILD_CORES options manpage \ nixos-render-docs -j $NIX_BUILD_CORES options manpage \
--revision ${revision} \ --revision ${revision} \
--header ${./home-configuration-nix-header.5} \ --header ${./header.5} \
--footer ${./home-configuration-nix-footer.5} \ --footer ${./footer.5} \
${nvimModuleDocs.optionsJSON}/share/doc/nixos/options.json \ ${nvimModuleDocs.optionsJSON}/share/doc/nixos/options.json \
$out/share/man/man5/home-configuration.nix.5 $out/share/man/man5/neovim-flake.5
cp ${./home-manager.1} $out/share/man/man1/home-manager.1 cp ${./neovim-flake.1} $out/share/man/man1/neovim-flake.1
''; '';
# Generate the HTML manual pages # Generate the HTML manual pages
neovim-flake-manual = pkgs.callPackage ./manual.nix { neovim-flake-manual = pkgs.callPackage ./manual.nix {
@ -125,13 +125,13 @@ in {
meta.description = "List of Home Manager options in JSON format"; meta.description = "List of Home Manager options in JSON format";
} '' } ''
mkdir -p $out/{share/doc,nix-support} mkdir -p $out/{share/doc,nix-support}
cp -a ${nvimModuleDocs.optionsJSON}/share/doc/nixos $out/share/doc/home-manager cp -a ${nvimModuleDocs.optionsJSON}/share/doc/nixos $out/share/doc/neovim-flake
substitute \ substitute \
${nvimModuleDocs.optionsJSON}/nix-support/hydra-build-products \ ${nvimModuleDocs.optionsJSON}/nix-support/hydra-build-products \
$out/nix-support/hydra-build-products \ $out/nix-support/hydra-build-products \
--replace \ --replace \
'${nvimModuleDocs.optionsJSON}/share/doc/nixos' \ '${nvimModuleDocs.optionsJSON}/share/doc/nixos' \
"$out/share/doc/home-manager" "$out/share/doc/neovim-flake"
''; '';
}; };

3
docs/footer.5 Normal file
View file

@ -0,0 +1,3 @@
.SH "AUTHORS"
.PP
neovim-flake contributors

14
docs/header.5 Normal file
View file

@ -0,0 +1,14 @@
.TH "neovim-flake" "5" "01/01/1980" "neovim-flake"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" enable line breaks after slashes
.cflags 4 /
.SH "NAME"
neovim-flake configuration specification
.SH "OPTIONS"
.PP
You can use the following options in
home\-configuration\&.nix:
.PP

29
docs/neovim-flake.1 Normal file
View file

@ -0,0 +1,29 @@
.Dd January 1, 1980
.Dt neovim-flake 1
.Os neovim-flake
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" enable line breaks after slashes
.cflags 4 /
.Sh NAME
.Nm neovim-flake
.Nd a extensible and distro-agonistic Neovim configuration wrapper in Nix
.
.Sh BUGS
.Pp
Please report any bugs on the
\m[blue]\fBproject issue tracker\fR\m[]\&.
.Sh AUTHOR
.Pp
\fBneovim-flake contributors\fR
.RS 4
Author.
.RE
.Sh COPYRIGHT
.br
Copyright \(co 2017\(en2022 neovim-flake contributors
.br