mirror of
https://github.com/nix-community/home-manager.git
synced 2026-10-03 12:09:19 +00:00
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.
24 lines
441 B
Nix
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"
|
|
''
|