mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-09-11 14:35:30 +03:00
docs: separate public and internal modules
This commit is contained in:
parent
1633930077
commit
3b9e0780a0
@ -307,6 +307,14 @@ in {
|
||||
Remove local anchor links, a workaround for proper {option}`` support in the doc tooling.
|
||||
'';
|
||||
};
|
||||
|
||||
chapter = mkOption {
|
||||
type = types.str;
|
||||
default = "Chapter";
|
||||
description = ''
|
||||
Name of the chapter to put this modules docs in.
|
||||
'';
|
||||
};
|
||||
};
|
||||
config = {
|
||||
_nixosOptionsDoc = pkgs.nixosOptionsDoc {
|
||||
@ -373,14 +381,33 @@ in {
|
||||
# Summary
|
||||
# - [Reference Documentation]()
|
||||
# - [core (built in)](./options/core.md)
|
||||
generated-summary-md = pkgs.writeText "SUMMARY.md" ''
|
||||
${
|
||||
lib.concatStringsSep "\n"
|
||||
(lib.mapAttrsToList
|
||||
(name: inputCfg: " - [${inputCfg.sourceName}](./options/${name}.md)")
|
||||
cfg.inputs)
|
||||
}
|
||||
'';
|
||||
generated-summary-md = let
|
||||
chapters = lib.zipAttrs (
|
||||
lib.mapAttrsToList
|
||||
(name: inputCfg: {
|
||||
${inputCfg.chapter} = inputCfg // {inherit name;};
|
||||
})
|
||||
cfg.inputs
|
||||
);
|
||||
in
|
||||
pkgs.writeText "SUMMARY.md" ''
|
||||
${
|
||||
lib.concatStringsSep "\n"
|
||||
(
|
||||
lib.flatten (
|
||||
lib.mapAttrsToList
|
||||
(
|
||||
chapter: inputs:
|
||||
[" - [${chapter}]()"]
|
||||
++ (map
|
||||
(inputCfg: " - [${inputCfg.sourceName}](./options/${inputCfg.name}.md)")
|
||||
inputs)
|
||||
)
|
||||
chapters
|
||||
)
|
||||
)
|
||||
}
|
||||
'';
|
||||
generated-docs =
|
||||
pkgs.runCommand "generated-docs"
|
||||
{
|
||||
|
@ -21,6 +21,16 @@
|
||||
# doesn't need to be rendered
|
||||
"_template"
|
||||
];
|
||||
public = lib.genAttrs [
|
||||
"nodejs-devshell-v3"
|
||||
"nodejs-node-modules-v3"
|
||||
"nodejs-package-json-v3"
|
||||
"nodejs-package-lock-v3"
|
||||
"php-composer-lock"
|
||||
"pip"
|
||||
"rust-cargo-lock"
|
||||
"rust-crane"
|
||||
] (name: null);
|
||||
in {
|
||||
render.inputs =
|
||||
lib.flip lib.mapAttrs
|
||||
@ -48,6 +58,10 @@
|
||||
else "";
|
||||
baseUrl = "https://github.com/nix-community/dream2nix/blob/master";
|
||||
separateEval = true;
|
||||
chapter =
|
||||
if public ? ${name}
|
||||
then "Modules"
|
||||
else "Modules (Internal + Experimental)";
|
||||
});
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user