mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-02 13:24:28 +02:00
docs: fix documentation generation
This commit is contained in:
parent
5f67918bae
commit
dd9ec124a2
41 changed files with 55 additions and 552 deletions
35
docs.nix
Normal file
35
docs.nix
Normal 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
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue