diff --git a/docs/default.nix b/docs/default.nix
index 211bf38..2a5142c 100644
--- a/docs/default.nix
+++ b/docs/default.nix
@@ -29,25 +29,68 @@
];
};
+ githubDeclaration = user: repo: subpath: let
+ urlRef = "main";
+ in {
+ url = "https://github.com/${user}/${repo}/blob/${urlRef}/${subpath}";
+ name = "<${repo}/${subpath}>";
+ };
+
dontCheckDefinitions = {_module.check = false;};
- nvimModuleDocs = nmd.buildModulesDocs {
+ nvimPath = toString ./..;
+
+ buildOptionsDocs = args @ {
+ modules,
+ includeModuleSystemsOptions ? true,
+ ...
+ }: let
+ options = (lib.evalModules {inherit modules;}).options;
+ in
+ pkgs.buildPackages.nixosOptionsDoc
+ ({
+ options =
+ if includeModuleSystemsOptions
+ then options
+ else builtins.removeAttrs (options ["_module"]);
+ transformOptions = opt:
+ opt
+ // {
+ # Clean up declaration sites to not refer to local source tree
+ declarations =
+ map
+ (decl:
+ if lib.hasPrefix nvimPath (toString decl)
+ then
+ githubDeclaration "notashelf" "neovim-flake"
+ (lib.removePrefix "/" (lib.removePrefix nvimPath (toString decl)))
+ else decl)
+ opt.declarations;
+ };
+ }
+ // builtins.removeAttrs args ["modules" "includeModuleSystemsOptions"]);
+
+ nvimModuleDocs = buildOptionsDocs {
modules =
- import ../modules/modules.nix {
+ import ../modules/modules.nix
+ {
inherit pkgs lib;
check = false;
}
- ++ [scrubbedPkgsModule dontCheckDefinitions];
- moduleRootPaths = [./..];
- mkModuleUrl = path: "https://github.com/notashelf/neovim-flake/blob/main/${path}#blob-path";
- channelName = "neovim-flake";
- docBook.id = "neovim-flake-options";
+ ++ [scrubbedPkgsModule];
+ variablelistId = "neovim-flake-options";
};
docs = nmd.buildDocBookDocs {
pathName = "neovim-flake";
projectName = "neovim-flake";
- modulesDocs = [nvimModuleDocs];
+ modulesDocs = [
+ {
+ docBook = pkgs.linkFarm "nvim-module-docs-for-nmd" {
+ "nmd-result/neovim-flake-options.xml" = nvimModuleDocs.optionsDocBook;
+ };
+ }
+ ];
documentsDirectory = ./.;
documentType = "book";
chunkToc = ''
@@ -65,7 +108,24 @@
'';
};
in {
- options.json = nvimModuleDocs.json.override {path = "share/doc/neovim-flake/options.json";};
- manPages = docs.manPages;
+ options.json =
+ pkgs.runCommand "options.json"
+ # TODO: Use `nvimOptionsDoc.optionsJSON` directly once upstream
+ # `nixosOptionsDoc` is more customizable
+ {
+ meta.description = "List of neovim-flake options in JSON format";
+ } ''
+ mkdir -p $out/{share/doc,nix-support}
+ cp -a ${nvimModuleDocs.optionsJSON}/share/doc/nixos $out/share/doc/neovim-flake
+ substitute \
+ ${nvimModuleDocs.optionsJSON}/nix-support/hydra-build-products \
+ $out/nix-support/hydra-build-products \
+ --replace \
+ '${nvimModuleDocs.optionsJSON}/share/doc/nixos' \
+ "$out/share/doc/neovim-flake"
+ '';
+
+ inherit (docs) manPages;
+
manual = {inherit (docs) html htmlOpenTool;};
}
diff --git a/docs/man-configuration.xml b/docs/man-configuration.xml
index 84e914e..e0c870f 100644
--- a/docs/man-configuration.xml
+++ b/docs/man-configuration.xml
@@ -45,6 +45,6 @@
You can use the following options in your neovim configuration.
-
+
diff --git a/docs/manual.xml b/docs/manual.xml
index 0584b9c..2278f9a 100644
--- a/docs/manual.xml
+++ b/docs/manual.xml
@@ -25,7 +25,6 @@
Configuration Options
-
+
-
diff --git a/docs/manual/hacking.adoc b/docs/manual/hacking.adoc
index 33ed8e0..51995b8 100644
--- a/docs/manual/hacking.adoc
+++ b/docs/manual/hacking.adoc
@@ -144,6 +144,7 @@ For example:
[source,nix]
----
# parent modules should always be unfolded
+# which means module = { value = ... } instead of module.value = { ... }
module = {
value = mkEnableOption "some description" // { default = true; }; # merges can be done inline where possible
@@ -202,7 +203,7 @@ without any error messages (you can check the output of `:messages` inside neovi
your changes are good to go. Open your pull request, and it will be reviewed as soon as posssible.
If it is not a new module, but a change to an existing one, then make sure the module you have changed is enabled in the
-maximal configuration by editing configuration.nix, and then run it with `nix run .#maximal -Lv`. Same procedure as
+maximal configuration by editing `configuration.nix`, and then run it with `nix run .#maximal -Lv`. Same procedure as
adding a new module will apply here.
[[sec-keybinds]]
diff --git a/docs/release-notes/rl-0.5.adoc b/docs/release-notes/rl-0.5.adoc
index f0c72b8..bc0dde9 100644
--- a/docs/release-notes/rl-0.5.adoc
+++ b/docs/release-notes/rl-0.5.adoc
@@ -74,6 +74,11 @@ https://github.com/notashelf[notashelf]:
* Added `nvim-docs-view`, a plugin to display lsp hover documentation in a side panel
+* Switched to `nixosOptionsDoc` in option documentation.
+To quote home-manager commit: "Output is mostly unchanged aside from some minor typographical and
+formatting changes, along with better source links."
+
+
https://github.com/jacekpoz[jacekpoz]:
* Fixed scrollOffset not being used
diff --git a/lib/default.nix b/lib/default.nix
index ad6771a..2bdaab6 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -3,6 +3,5 @@
booleans = import ./booleans.nix {inherit lib;};
types = import ./types {inherit lib;};
languages = import ./languages.nix {inherit lib;};
- nmd = import ./nmd.nix;
lua = import ./lua.nix {inherit lib;};
}
diff --git a/lib/stdlib-extended.nix b/lib/stdlib-extended.nix
index a54e5e9..9833248 100644
--- a/lib/stdlib-extended.nix
+++ b/lib/stdlib-extended.nix
@@ -70,5 +70,4 @@ in
# For forward compatibility.
literalExpression = super.literalExpression or super.literalExample;
- literalDocBook = super.literalDocBook or super.literalExample;
})
diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix
index 344c405..ee33a42 100644
--- a/lib/types/plugins.nix
+++ b/lib/types/plugins.nix
@@ -112,6 +112,7 @@ with lib; let
options = {
package = mkOption {
type = pluginType;
+ description = "Plugin Package.";
};
after = mkOption {
type = listOf str;
diff --git a/modules/autopairs/nvim-autopairs/nvim-autopairs.nix b/modules/autopairs/nvim-autopairs/nvim-autopairs.nix
index 9dc8c64..d64b5cb 100644
--- a/modules/autopairs/nvim-autopairs/nvim-autopairs.nix
+++ b/modules/autopairs/nvim-autopairs/nvim-autopairs.nix
@@ -15,7 +15,7 @@ with builtins; {
map_cr = mkOption {
type = types.bool;
default = true;
- description = nvim.nmd.asciiDoc ''map on insert mode'';
+ description = ''map on insert mode'';
};
map_complete = mkOption {
diff --git a/modules/completion/nvim-cmp/nvim-cmp.nix b/modules/completion/nvim-cmp/nvim-cmp.nix
index fa7041b..fb9be86 100644
--- a/modules/completion/nvim-cmp/nvim-cmp.nix
+++ b/modules/completion/nvim-cmp/nvim-cmp.nix
@@ -22,7 +22,7 @@ with builtins; {
};
sources = mkOption {
- description = nvim.nmd.asciiDoc ''
+ description = ''
Attribute set of source names for nvim-cmp.
If an attribute set is provided, then the menu value of
@@ -40,23 +40,22 @@ with builtins; {
formatting = {
format = mkOption {
- description = nvim.nmd.asciiDoc ''
+ description = ''
The function used to customize the appearance of the completion menu.
- If <> is true, then the function
+ If [](#opt-vim.lsp.lspkind.enable) is true, then the function
will be called before modifications from lspkind.
Default is to call the menu mapping function.
'';
type = types.str;
default = "nvim_cmp_menu_map";
- example = nvim.nmd.literalAsciiDoc ''
- [source,lua]
- ---
+ example = lib.literalMD ''
+ ```lua
function(entry, vim_item)
return vim_item
end
- ---
+ ```
'';
};
};
diff --git a/modules/core/default.nix b/modules/core/default.nix
index fd097ef..2a35262 100644
--- a/modules/core/default.nix
+++ b/modules/core/default.nix
@@ -27,23 +27,23 @@ with builtins; let
mapConfigOptions = {
silent =
mkBool false
- (nvim.nmd.asciiDoc "Whether this mapping should be silent. Equivalent to adding to a map.");
+ "Whether this mapping should be silent. Equivalent to adding to a map.";
nowait =
mkBool false
- (nvim.nmd.asciiDoc "Whether to wait for extra input on ambiguous mappings. Equivalent to adding to a map.");
+ "Whether to wait for extra input on ambiguous mappings. Equivalent to adding to a map.";
script =
mkBool false
- (nvim.nmd.asciiDoc "Equivalent to adding