docs: Add basic documentation system based on nmd

You can now run `nix build '.#docs'` to build HTML documentation
documenting every single option on nixvim! Fortunately, thanks to
the 'description' field, most options are already documented, but
there are still a fair few that need documenting.

I will be taking care of those in the next few days. When those are
done, I will find a way to automatically rebuild documentation on every
repo push, and also add a PR hook requiring documentation.

Additionally, I will try to find a way to have per-page plugin docs.
This commit is contained in:
Pedro Alves 2022-01-10 19:50:13 +00:00
parent 69cf1b6204
commit eef84178ab
42 changed files with 184 additions and 51 deletions

51
docs/default.nix Normal file
View file

@ -0,0 +1,51 @@
{ pkgs, lib, ... }:
let
nmdSrc = pkgs.fetchFromGitLab {
name = "nmd";
owner = "rycee";
repo = "nmd";
rev = "527245ff605bde88c2dd2ddae21c6479bb7cf8aa";
sha256 = "1zi0f9y3wq4bpslx1py3sfgrgd9av41ahpandvs6rvkpisfsqqlp";
};
nmd = import nmdSrc { inherit pkgs lib; };
scrubbedPkgsModule = {
imports = [{
_module.args = {
pkgs = lib.mkForce (nmd.scrubDerivations "pkgs" pkgs);
pkgs_i686 = lib.mkForce { };
};
}];
};
buildModulesDocs = args:
nmd.buildModulesDocs ({
moduleRootPaths = [ ./.. ];
mkModuleUrl = path:
"https://github.com/pta2002/nixvim/blob/master/${path}#blob-path";
channelName = "nixvim";
} // args);
nixvimDocs = buildModulesDocs {
modules = [
(import ../nixvim.nix {})
scrubbedPkgsModule
];
docBook.id = "nixvim-options";
};
docs = nmd.buildDocBookDocs {
pathName = "";
modulesDocs = [ nixvimDocs ];
documentsDirectory = ./.;
documentType = "book";
chunkToc = ''
<toc>
<d:tocentry xmlns:d="http://docbook.org/ns/docbook" linkend="book-home-manager-manual"><?dbhtml filename="index.html"?>
<d:tocentry linkend="ch-options"><?dbhtml filename="options.html"?></d:tocentry>
<d:tocentry linkend="ch-nixos-options"><?dbhtml filename="nixos-options.html"?></d:tocentry>
<d:tocentry linkend="ch-nix-darwin-options"><?dbhtml filename="nix-darwin-options.html"?></d:tocentry>
<d:tocentry linkend="ch-tools"><?dbhtml filename="tools.html"?></d:tocentry>
<d:tocentry linkend="ch-release-notes"><?dbhtml filename="release-notes.html"?></d:tocentry>
</d:tocentry>
</toc>
'';
};
in docs.html

27
docs/man-nixvim.xml Normal file
View file

@ -0,0 +1,27 @@
<refentry xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude">
<refmeta>
<refentrytitle><filename>nixvim.nix</filename></refentrytitle>
<manvolnum>5</manvolnum>
<refmiscinfo class="source">NixVim</refmiscinfo>
<!-- <refmiscinfo class="version"><xi:include href="version.txt" parse="text"/></refmiscinfo> -->
</refmeta>
<refnamediv>
<refname><filename>nixvim.nix</filename></refname>
<refpurpose>NixVim configuration specification</refpurpose>
</refnamediv>
<refsection>
<title>Description</title>
<para>
TODO
</para>
</refsection>
<refsection>
<title>Options</title>
<para>
You can use the following options in your nixvim config
</para>
<xi:include href="./nmd-result/nixvim-options.xml" />
</refsection>
</refentry>

11
docs/man-pages.xml Normal file
View file

@ -0,0 +1,11 @@
<reference xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude">
<title>NixVim Reference Pages</title>
<info>
<author><personname>NixVim contributors</personname></author>
<copyright><year>2021-2022</year><holder>NixVim contributors</holder>
</copyright>
</info>
<xi:include href="man-nixvim.xml" />
</reference>

23
docs/manual.xml Normal file
View file

@ -0,0 +1,23 @@
<book xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="book-home-manager-manual">
<info>
<title>NixVim Manual</title>
</info>
<preface>
<title>Preface</title>
<para>
This manual is meant to serve as the ultimate reference for how to use and install NixVim.
</para>
<para>
If you have any issues, questions, or plugin suggestions please open an issue on the
<link xlink:href="https://github.com/pta2002/nixvim">NixVim GitHub</link>
</para>
</preface>
<appendix xml:id="ch-options">
<title>Configuration Options</title>
<xi:include href="./nmd-result/nixvim-options.xml" />
</appendix>
</book>

29
docs/plugins.md Normal file
View file

@ -0,0 +1,29 @@
# List of plugins for NixVim
## Colorschemes
### Gruvbox
Just set `enable` to use the colorscheme.
```nix
programs.nixvim.colorscheme.gruvbox.enable = true;
```
## Status lines
### Lightline
Lightline is a small and customizable status line for vim. It can be enabled
with `programs.nixvim.plugins.lightline.enable`, and it will try to use the
colorscheme set by the user. If you want to manually override this, set
`programs.nixvim.plugins.lightline.colorscheme` to the name of the colorscheme
to use.
```nix
programs.nixvim.plugins.lightline = {
enable = true; # Enable this plugin
# This can be set to null to reset. Defaults to global colorscheme
colorscheme = "wombat";
# ...
};
```

View file

@ -0,0 +1,155 @@
# base16
Base16 is a set of colorschemes, so it comes with several themes you can choose from:
- 3024
- apathy
- ashes
- atelier-cave-light
- atelier-cave
- atelier-dune-light
- atelier-dune
- atelier-estuary-light
- atelier-estuary
- atelier-forest-light
- atelier-forest
- atelier-heath-light
- atelier-heath
- atelier-lakeside-light
- atelier-lakeside
- atelier-plateau-light
- atelier-plateau
- atelier-savanna-light
- atelier-savanna
- atelier-seaside-light
- atelier-seaside
- atelier-sulphurpool-light
- atelier-sulphurpool
- atlas
- bespin
- black-metal-bathory
- black-metal-burzum
- black-metal-dark-funeral
- black-metal-gorgoroth
- black-metal-immortal
- black-metal-khold
- black-metal-marduk
- black-metal-mayhem
- black-metal-nile
- black-metal-venom
- black-metal
- brewer
- bright
- brogrammer
- brushtrees-dark
- brushtrees
- chalk
- circus
- classic-dark
- classic-light
- codeschool
- cupcake
- cupertino
- darktooth
- default-dark
- default-light
- dracula
- eighties
- embers
- flat
- fruit-soda
- github
- google-dark
- google-light
- grayscale-dark
- grayscale-light
- greenscreen
- gruvbox-dark-hard
- gruvbox-dark-medium
- gruvbox-dark-pale
- gruvbox-dark-soft
- gruvbox-light-hard
- gruvbox-light-medium
- gruvbox-light-soft
- harmonic-dark
- harmonic-light
- heetch-light
- heetch
- helios
- hopscotch
- horizon-dark
- ia-dark
- ia-light
- icy
- irblack
- isotope
- macintosh
- marrakesh
- material-darker
- material-lighter
- material-palenight
- material
- material-vivid
- materia
- mellow-purple
- mexico-light
- mocha
- monokai
- nord
- oceanicnext
- ocean
- onedark
- one-light
- outrun-dark
- papercolor-dark
- papercolor-light
- paraiso
- phd
- pico
- pop
- porple
- railscasts
- rebecca
- seti
- shapeshifter
- snazzy
- solarflare
- solarized-dark
- solarized-light
- spacemacs
- summerfruit-dark
- summerfruit-light
- synth-midnight-dark
- tomorrow-night-eighties
- tomorrow-night
- tomorrow
- tube
- twilight
- unikitty-dark
- unikitty-light
- woodland
- xcode-dusk
- zenburn
More information can be found on the official base16 website, [here](http://chriskempson.com/projects/base16/).
## Options
### `colorschemes.base16.enable`
**Description**: Enables base16
**Type**: `bool`
### `colorschemes.base16.useTruecolor`
**Description**: Whether to use truecolor for the colorschemes. If set to
false, you'll need to set up base16 in your shell.
**Type**: `bool`
**Default**: `true`
### `colorschemes.base16.setUpBar`
**Description**: Whether to install the matching plugin for your statusbar. This does nothing as of yet, waiting for upstream support.
**Type**: `bool`
**Default**: `true`

View file

@ -0,0 +1,144 @@
# gruvbox
This plugin sets up the `gruvbox` colorscheme.
## Options
### `colorschemes.gruvbox.enable`
**Description**: Enable gruvbox
**Type**: `bool`
### `colorschemes.gruvbox.italics`
**Description**: Enable italics
**Type**: `bool`
### `colorschemes.gruvbox.bold`
**Description**: Enable bold
**Type**: `bool`
### `colorschemes.gruvbox.underline`
**Description**: Enable underlined text
**Type**: `bool`
### `colorschemes.gruvbox.undercurl`
**Description**: Enable undercurled text
**Type**: `bool`
### `colorschemes.gruvbox.contrastDark`
**Description**: Contrast for the dark mode
**Type**: `nullOr (enum [ "soft" "medium" "hard" ])`
**Default**: `null`
### `colorschemes.gruvbox.contrastLight`
**Type**: `nullOr (enum [ "soft" "medium" "hard" ])`
**Default**: `null`
**Description**: "Contrast for the light mode";
### `colorschemes.gruvbox.highlightSearchCursor`
**Type**: `nullOr colors`
**Default**: `null`
**Description**: "The cursor background while search is highlighted";
### `colorschemes.gruvbox.numberColumn`
**Description**: The number column background
**Type**: `nullOr colors`
**Default**: `null`
### `colorschemes.gruvbox.signColumn`
**Description**: "The sign column background";
**Type**: `nullOr colors`
**Default**: `null`
### `colorschemes.gruvbox.colorColumn`
**Description**: "The color column background";
**Type**: `nullOr colors`
**Default**: `null`
### `colorschemes.gruvbox.vertSplitColor`
**Description**: "The vertical split background color";
**Type**: `nullOr colors`
**Default**: `null`
### `colorschemes.gruvbox.italicizeComments`
**Description**: "Italicize comments";
**Type**: `bool`
**Default**: `true`
### `colorschemes.gruvbox.italicizeStrings`
**Description**: "Italicize strings";
**Type**: `bool`
**Default**: `false`
### `colorschemes.gruvbox.invertSelection`
**Description**: "Invert the select text";
**Type**: `bool`
**Default**: `true`
### `colorschemes.gruvbox.invertSigns`
**Description**: "Invert GitGutter and Syntastic signs";
**Type**: `bool`
**Default**: `false`
### `colorschemes.gruvbox.invertIndentGuides`
**Description**: "Invert indent guides";
**Type**: `bool`
**Default**: `false`
### `colorschemes.gruvbox.invertTabline`
**Description**: "Invert tabline highlights";
**Type**: `bool`
**Default**: `false`
### `colorschemes.gruvbox.improvedStrings`
**Description**: "Improved strings";
**Type**: `bool`
**Default**: `false`
### `colorschemes.gruvbox.improvedWarnings`
**Description**: "Improved warnings";
**Type**: `bool`
**Default**: `false`
### `colorschemes.gruvbox.transparentBg`
**Description**: Transparent background
**Type**: `bool`
### `colorschemes.gruvbox.trueColor`
**Description**: Enable true color support
**Type**: `bool`

View file

@ -0,0 +1,6 @@
# vim-one
## Options
### `colorschemes.one.enable`
**Description**: Enable vim-one
**Type**: `bool`

View file

@ -0,0 +1,6 @@
# onedark
## Options
### `colorschemes.onedark.enable`
**Description**: Enable onedark
**Type**: `bool`

View file

@ -0,0 +1,70 @@
# tokyonight
This plugin sets up the `tokyonight` colorscheme.
## Options
### `colorschemes.tokyonight.enable`
**Description**: Enable tokyonight
**Type***: `bool`
### `colorschemes.tokyonight.style`
**Description**: Theme style
**Type**: `nullOr (enum [ "storm" "night" "day" ])`
**Default**: `null`
### `colorschemes.tokyonight.terminalColors`
**Description**: Configure the colors used when opening a `:terminal` in Neovim
**Type**: `bool`
### `colorschemes.tokyonight.italicComments`
**Description**: Make comments italic
**Type**: `bool`
### `colorschemes.tokyonight.italicKeywords`
**Description**: Make keywords italic
**Type**: `bool`
### `colorschemes.tokyonight.italicFunctions`
**Description**: Make functions italic
**Type**: `bool`
### `colorschemes.tokyonight.italicVariables`
**Description**: Make variables and identifiers italic
**Type**: `bool`
### `colorschemes.tokyonight.transparent`
**Description**: Enable this to disable setting the background color
**Type**: `bool`
### `colorschemes.tokyonight.hideInactiveStatusline`
**Description**: Enabling this option will hide inactive statuslines and replace them with a thin border
**Type**: `bool`
### `colorschemes.tokyonight.transparentSidebar`
**Description**: Sidebar like windows like NvimTree get a transparent background
**Type**: `bool`
### `colorschemes.tokyonight.darkSidebar`
**Description**: Sidebar like windows like NvimTree get a darker background
**Type**: `bool`
### `colorschemes.tokyonight.darkFloat`
**Description**: Float windows like the lsp diagnostic windows get a darker background
**Type**: `bool`
### `colorschemes.tokyonight.lualineBold`
**Description**: When true, section headers in the lualine theme will be bold
**Type**: `bool`

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file