mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-25 12:39:49 +01:00
docs: filter source by markdown
This commit is contained in:
parent
67927b5f65
commit
2d08f3ad39
3 changed files with 26 additions and 16 deletions
docs
|
@ -2,11 +2,17 @@
|
|||
inputs,
|
||||
pkgs,
|
||||
lib ? import ../lib/stdlib-extended.nix pkgs.lib inputs,
|
||||
manpageUrls ? pkgs.path + "/doc/manpage-urls.json",
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkForce evalModules;
|
||||
inherit (lib.strings) hasPrefix removePrefix;
|
||||
inherit (lib.attrsets) isAttrs mapAttrs optionalAttrs recursiveUpdate isDerivation;
|
||||
inherit (builtins) fromJSON readFile;
|
||||
|
||||
# release data
|
||||
release-config = fromJSON (readFile ../release.json);
|
||||
revision = release-config.release;
|
||||
|
||||
# From home-manager:
|
||||
#
|
||||
|
@ -54,11 +60,14 @@
|
|||
buildOptionsDocs = args @ {
|
||||
modules,
|
||||
includeModuleSystemOptions ? true,
|
||||
warningsAreErrors ? true,
|
||||
...
|
||||
}: let
|
||||
inherit ((evalModules {inherit modules;})) options;
|
||||
|
||||
# Declaration of the Github site URL.
|
||||
# Takes a user, repo, and subpath, and returns a declaration site
|
||||
# as a string.
|
||||
githubDeclaration = user: repo: subpath: let
|
||||
urlRef = "github.com";
|
||||
branch = "main";
|
||||
|
@ -68,10 +77,13 @@
|
|||
};
|
||||
in
|
||||
pkgs.buildPackages.nixosOptionsDoc ({
|
||||
inherit warningsAreErrors;
|
||||
|
||||
options =
|
||||
if includeModuleSystemOptions
|
||||
then options
|
||||
else builtins.removeAttrs options ["_module"];
|
||||
|
||||
transformOptions = opt:
|
||||
recursiveUpdate opt {
|
||||
# Clean up declaration sites to not refer to the neovim-flakee
|
||||
|
@ -93,18 +105,16 @@
|
|||
// builtins.removeAttrs args ["modules" "includeModuleSystemOptions"]);
|
||||
|
||||
nvimModuleDocs = buildOptionsDocs {
|
||||
variablelistId = "neovim-flake-options";
|
||||
|
||||
modules =
|
||||
import ../modules/modules.nix {
|
||||
inherit lib pkgs;
|
||||
check = false;
|
||||
}
|
||||
++ [scrubbedPkgsModule];
|
||||
variablelistId = "neovim-flake-options";
|
||||
};
|
||||
|
||||
release-config = builtins.fromJSON (builtins.readFile ../release.json);
|
||||
revision = release-config.release;
|
||||
|
||||
# Generate the `man home-configuration.nix` package
|
||||
nvf-configuration-manual =
|
||||
pkgs.runCommand "neovim-flake-reference-manpage" {
|
||||
|
@ -125,7 +135,7 @@
|
|||
|
||||
# Generate the HTML manual pages
|
||||
neovim-flake-manual = pkgs.callPackage ./manual.nix {
|
||||
inherit revision;
|
||||
inherit revision manpageUrls;
|
||||
outputPath = "share/doc/neovim-flake";
|
||||
options = {
|
||||
neovim-flake = nvimModuleDocs.optionsJSON;
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
{
|
||||
stdenv,
|
||||
lib,
|
||||
documentation-highlighter,
|
||||
revision,
|
||||
outputPath ? "share/doc/neovim-flake",
|
||||
options,
|
||||
stdenvNoCC,
|
||||
# build inputs
|
||||
nixos-render-docs,
|
||||
documentation-highlighter,
|
||||
# nrd configuration
|
||||
manpageUrls,
|
||||
revision,
|
||||
options,
|
||||
outputPath ? "share/doc/neovim-flake",
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
stdenvNoCC.mkDerivation {
|
||||
name = "neovim-flake-manual";
|
||||
src = builtins.path {
|
||||
path = ./manual;
|
||||
path = lib.sourceFilesBySuffices ./manual [".md"];
|
||||
name = "neovim-flake-manual";
|
||||
};
|
||||
|
||||
|
@ -43,7 +46,7 @@ stdenv.mkDerivation {
|
|||
|
||||
# generate manual from
|
||||
nixos-render-docs manual html \
|
||||
--manpage-urls ./manpage-urls.json \
|
||||
--manpage-urls ${manpageUrls} \
|
||||
--revision ${lib.trivial.revisionWithDefault revision} \
|
||||
--stylesheet style.css \
|
||||
--script highlightjs/highlight.pack.js \
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"nix.conf(5)": "https://nixos.org/manual/nix/stable/command-ref/conf-file.html"
|
||||
}
|
Loading…
Reference in a new issue