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

View file

@ -1,5 +1,5 @@
{ nixos ? false, nixOnDroid ? false, homeManager ? false }:
{ pkgs, lib, config, ... }:
{ pkgs , lib, config, ... }:
with lib;
let
cfg = config.programs.nixvim;
@ -100,8 +100,9 @@ in
};
colorscheme = mkOption {
type = types.str;
type = types.nullOr types.str;
description = "The name of the colorscheme";
default = null;
};
extraConfigLua = mkOption {
@ -126,6 +127,7 @@ in
configure = mkOption {
type = types.attrsOf types.anything;
default = { };
description = "Internal option";
};
options = mkOption {
@ -257,7 +259,7 @@ in
in mkIf cfg.enable (if nixos then {
environment.systemPackages = [ wrappedNeovim ];
programs.nixvim = {
programs.neovim = {
configure = configure;
extraConfigLua = extraConfigLua;
@ -273,14 +275,5 @@ in
extraConfig = configure.customRC;
plugins = cfg.extraPlugins;
};
} else {
environment.packages = [ wrappedNeovim ];
programs.nixvim = {
configure = configure;
extraConfigLua = extraConfigLua;
};
environment.etc."xdg/nvim/sysinit.vim".text = neovimConfig.neovimRcContent;
}));
} else {}));
}