docs: fix documentation generation

This commit is contained in:
Pedro Alves 2022-12-29 17:34:47 +00:00
parent 5f67918bae
commit dd9ec124a2
41 changed files with 55 additions and 552 deletions

View file

@ -56,4 +56,4 @@ workflows:
- build-docs
filters:
branches:
only: main
only: main

35
docs.nix Normal file
View file

@ -0,0 +1,35 @@
{ pkgs, lib, modules, ... }:
let
options = lib.evalModules {
modules = modules;
specialArgs = { inherit pkgs lib; };
};
docs = pkgs.nixosOptionsDoc {
# If we don't do this, we end up with _module.args on the generated options, which we do not want
options = lib.filterAttrs (k: _: k != "_module") options.options;
warningsAreErrors = false;
};
asciidoc = docs.optionsAsciiDoc;
in
pkgs.stdenv.mkDerivation {
name = "nixvim-docs";
src = asciidoc;
buildInputs = [
pkgs.asciidoctor
];
phases = [ "buildPhase" ];
buildPhase = ''
mkdir -p $out/share
cat <<EOF > header.adoc
= NixVim options
This lists all the options available for NixVim.
:toc:
EOF
cat header.adoc $src > tmp.adoc
asciidoctor tmp.adoc -o $out/share/index.html
'';
}

View file

@ -1,48 +0,0 @@
{ pkgs ? import <nixpkgs> { }
, lib ? import <nixpkgs/lib>
, nmdSrc
, nixvimModules ? [ ]
, ...
}:
let
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/main/${path}#blob-path";
channelName = "nixvim";
} // args);
nixvimDocs = buildModulesDocs {
modules = [
scrubbedPkgsModule
] ++ nixvimModules;
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-nixvim-manual"><?dbhtml filename="index.html"?>
<d:tocentry linkend="ch-options"><?dbhtml filename="options.html"?></d:tocentry>
<d:tocentry linkend="ch-release-notes"><?dbhtml filename="release-notes.html"?></d:tocentry>
</d:tocentry>
</toc>
'';
};
in
# TODO: Parse this json or something, since docbook isn't working (and it's kind of terrible anyway)
nixvimDocs.json

View file

@ -1,27 +0,0 @@
<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>

View file

@ -1,11 +0,0 @@
<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>

View file

@ -1,23 +0,0 @@
<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>

View file

@ -1,29 +0,0 @@
# 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

@ -1,155 +0,0 @@
# 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

@ -1,144 +0,0 @@
# 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

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

View file

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

View file

@ -1,70 +0,0 @@
# 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`

19
flake.lock generated
View file

@ -51,22 +51,6 @@
"type": "indirect"
}
},
"nmdSrc": {
"flake": false,
"locked": {
"lastModified": 1666190571,
"narHash": "sha256-Z1hc7M9X6L+H83o9vOprijpzhTfOBjd0KmUTnpHAVjA=",
"owner": "rycee",
"repo": "nmd",
"rev": "b75d312b4f33bd3294cd8ae5c2ca8c6da2afc169",
"type": "gitlab"
},
"original": {
"owner": "rycee",
"repo": "nmd",
"type": "gitlab"
}
},
"poetry2nix": {
"inputs": {
"flake-utils": [
@ -96,8 +80,7 @@
"inputs": {
"beautysh": "beautysh",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"nmdSrc": "nmdSrc"
"nixpkgs": "nixpkgs"
}
},
"utils": {

View file

@ -3,13 +3,10 @@
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nmdSrc.url = "gitlab:rycee/nmd";
inputs.nmdSrc.flake = false;
inputs.beautysh.url = "github:lovesegfault/beautysh";
inputs.beautysh.inputs.nixpkgs.follows = "nixpkgs";
outputs = { self, nixpkgs, nmdSrc, flake-utils, ... }@inputs:
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
with nixpkgs.lib;
with builtins;
let
@ -30,7 +27,7 @@
};
})
./plugins/default.nix
# ./plugins/default.nix
];
flakeOutput =
@ -40,11 +37,8 @@
pkgs = import nixpkgs { inherit system; };
in
{
packages.docs = import ./docs {
pkgs = import nixpkgs { inherit system; };
lib = nixpkgs.lib;
nixvimModules = nixvimModules;
inherit nmdSrc;
packages.docs = pkgs.callPackage (import ./docs.nix) {
modules = nixvimModules;
};
legacyPackages.makeNixvim = import ./wrappers/standalone.nix pkgs (modules pkgs);

View file

@ -1,4 +1,7 @@
{ config, lib, helpers, ... }:
{ config, lib, ... }:
let
helpers = import ../plugins/helpers.nix { inherit lib; };
in
with lib;
{
options = {

View file

@ -1,6 +1,8 @@
{ config, lib, helpers, ... }:
{ config, lib, ... }:
with lib;
let
helpers = import ../plugins/helpers.nix { inherit lib; };
mapOption = types.oneOf [
types.str
(types.submodule {

View file

@ -1,5 +1,8 @@
{ config, lib, helpers, ... }:
{ config, lib, ... }:
with lib;
let
helpers = import ../plugins/helpers.nix { inherit lib; };
in
{
options = {
options = mkOption {

View file

@ -18,6 +18,7 @@ in
colorscheme = mkOption {
type = types.enum themes;
description = "The base16 colorscheme to use";
default = head themes;
};
setUpBar = mkOption {

View file

@ -1,8 +1,9 @@
{ pkgs, config, lib, helpers, ... }:
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.colorschemes.tokyonight;
style = types.enum [ "storm" "night" "day" ];
helpers = import ../helpers.nix { inherit lib; };
in
{
options = {