mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 19:55:41 +03:00
doc: render nixpkgs manual with nrd
also updates nixdoc to 2.3.0. the nixdoc update is not a separate commit because that would leave the manual build broken for one commit, potentially breaking bisects and rebases.
This commit is contained in:
parent
b521f451a3
commit
be4d19ff1a
34 changed files with 395 additions and 729 deletions
|
@ -58,28 +58,18 @@ let
|
|||
[ "-prime" ];
|
||||
|
||||
urlPrefix = "https://github.com/NixOS/nixpkgs/blob/${revision}";
|
||||
xmlstrings = (nixpkgsLib.strings.concatMapStrings
|
||||
({ name, value }:
|
||||
''
|
||||
<section><title>${name}</title>
|
||||
<para xml:id="${sanitizeId name}">
|
||||
Located at
|
||||
<link
|
||||
xlink:href="${urlPrefix}/${value.file}#L${builtins.toString value.line}">${value.file}:${builtins.toString value.line}</link>
|
||||
in <literal><nixpkgs></literal>.
|
||||
</para>
|
||||
</section>
|
||||
'')
|
||||
relativeLocs);
|
||||
jsonLocs = builtins.listToAttrs
|
||||
(builtins.map
|
||||
({ name, value }: {
|
||||
name = sanitizeId name;
|
||||
value =
|
||||
let
|
||||
text = "${value.file}:${builtins.toString value.line}";
|
||||
target = "${urlPrefix}/${value.file}#L${builtins.toString value.line}";
|
||||
in
|
||||
"[${text}](${target}) in `<nixpkgs>`";
|
||||
})
|
||||
relativeLocs);
|
||||
|
||||
in pkgs.writeText
|
||||
"locations.xml"
|
||||
''
|
||||
<section xmlns="http://docbook.org/ns/docbook"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="5">
|
||||
<title>All the locations for every lib function</title>
|
||||
<para>This file is only for inclusion by other files.</para>
|
||||
${xmlstrings}
|
||||
</section>
|
||||
''
|
||||
in
|
||||
pkgs.writeText "locations.json" (builtins.toJSON jsonLocs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue