diff options
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/lib/make-options-doc/default.nix | 3 | ||||
-rw-r--r-- | nixos/lib/make-options-doc/options-to-docbook.xsl | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/nixos/lib/make-options-doc/default.nix b/nixos/lib/make-options-doc/default.nix index 43dbff0e68dd..6a1bb868c20d 100644 --- a/nixos/lib/make-options-doc/default.nix +++ b/nixos/lib/make-options-doc/default.nix @@ -26,6 +26,8 @@ # If you include more than one option list into a document, you need to # provide different ids. , variablelistId ? "configuration-variable-list" + # Strig to prefix to the option XML/HTML id attributes. +, optionIdPrefix ? "opt-" , revision ? "" # Specify revision for the options # a set of options the docs we are generating will be merged into, as if by recursiveUpdate. # used to split the options doc build into a static part (nixos/modules) and a dynamic part @@ -183,6 +185,7 @@ in rec { --stringparam documentType '${documentType}' \ --stringparam revision '${revision}' \ --stringparam variablelistId '${variablelistId}' \ + --stringparam optionIdPrefix '${optionIdPrefix}' \ -o intermediate.xml ${./options-to-docbook.xsl} sorted.xml ${pkgs.libxslt.bin}/bin/xsltproc \ -o "$out" ${./postprocess-option-descriptions.xsl} intermediate.xml diff --git a/nixos/lib/make-options-doc/options-to-docbook.xsl b/nixos/lib/make-options-doc/options-to-docbook.xsl index 978d5e2468a8..d5b921b1dedb 100644 --- a/nixos/lib/make-options-doc/options-to-docbook.xsl +++ b/nixos/lib/make-options-doc/options-to-docbook.xsl @@ -15,6 +15,7 @@ <xsl:param name="documentType" /> <xsl:param name="program" /> <xsl:param name="variablelistId" /> + <xsl:param name="optionIdPrefix" /> <xsl:template match="/expr/list"> @@ -36,7 +37,7 @@ <xsl:attribute name="id" namespace="http://www.w3.org/XML/1998/namespace"><xsl:value-of select="$variablelistId"/></xsl:attribute> <xsl:for-each select="attrs"> <xsl:variable name="id" select=" - concat('opt-', + concat($optionIdPrefix, translate( attr[@name = 'name']/string/@value, '*< >[]:', |