Files
home-manager/docs/mdbook/options.nix
Peter Bittner e13ba5e5ab docs: link module pages without an invalid anchor
Drops the URL fragment from links that address a `programs.foo` or
`services.foo` page. Such a path names a module rather than an option,
so the page carries no matching anchor and the fragment pointed nowhere.
Option paths keep their fragment, including the single-segment options
`lib`, `specialisation` and `uninstall`, whose name equals their page
path.

Moves the anchor handling that convert-markup.py and render-options.py
had in common into a new option_links module imported by both. The
derivations therefore pass the mdbook directory instead of a single
script file, so the import resolves.
2026-08-12 07:40:00 -05:00

24 lines
441 B
Nix

{
pkgs,
optionDocs,
manpageUrls,
revision,
}:
pkgs.runCommand "home-manager-mdbook-options"
{
nativeBuildInputs = [
pkgs.buildPackages.nixos-render-docs
pkgs.buildPackages.python3
];
optionDocsJson = builtins.toJSON optionDocs;
passAsFile = [ "optionDocsJson" ];
}
''
python3 ${./.}/render-options.py \
"$optionDocsJsonPath" \
${manpageUrls} \
${revision} \
"$out"
''