docs: Correctly generate documentation for types either a (submodule ...) (#929)

This requires pulling quite a lot of code from nixpkgs in order to
make the `either` type work correctly, the effects can be seen for
example in the documentation of `ollama.promps` and `ollama.actions`
This commit is contained in:
traxys 2024-01-12 23:22:03 +01:00 committed by GitHub
parent 61da581315
commit 29225c2797
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 509 additions and 308 deletions

19
docs/man/default.nix Normal file
View file

@ -0,0 +1,19 @@
{
options-json,
runCommand,
installShellFiles,
nixos-render-docs,
}:
runCommand "nixvim-configuration-reference-manpage" {
nativeBuildInputs = [installShellFiles nixos-render-docs];
} ''
# Generate man-pages
mkdir -p $out/share/man/man5
nixos-render-docs -j $NIX_BUILD_CORES options manpage \
--revision unstable \
--header ${./nixvim-header.5} \
--footer ${./nixvim-footer.5} \
${options-json}/share/doc/nixos/options.json \
$out/share/man/man5/nixvim.5
compressManPages $out
''

3
docs/man/nixvim-footer.5 Normal file
View file

@ -0,0 +1,3 @@
.SH "AUTHORS"
.PP
nixvim maintainers

15
docs/man/nixvim-header.5 Normal file
View file

@ -0,0 +1,15 @@
.TH "NIXVIM" "5" "01/01/1980" "Nixvim" "Nixvim Reference Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" enable line breaks after slashes
.cflags 4 /
.SH "NAME"
nixvim options specification
.SH "DESCRIPTION"
.PP
This page lists all the options that can be used in nixvim. Nixvim can either be used as a Home-Manager module, an NixOS module or a standalone package. Please refer to the installation instructions for more details.
.SH "OPTIONS"
.PP
You can use the following options in a nixvim module.