lib.types.functionTo: Add pseudo-attr to generated docs

main
Robert Hensing 2 years ago
parent 06da97fc3a
commit 062bc5e74a
  1. 2
      lib/types.nix
  2. 14
      nixos/lib/make-options-doc/options-to-docbook.xsl

@ -526,7 +526,7 @@ rec {
check = isFunction;
merge = loc: defs:
fnArgs: (mergeDefinitions (loc ++ [ "[function body]" ]) elemType (map (fn: { inherit (fn) file; value = fn.value fnArgs; }) defs)).mergedValue;
getSubOptions = elemType.getSubOptions;
getSubOptions = prefix: elemType.getSubOptions (prefix ++ [ "[function body]" ]);
getSubModules = elemType.getSubModules;
substSubModules = m: functionTo (elemType.substSubModules m);
functor = (defaultFunctor "functionTo") // { wrapped = elemType; };

@ -20,7 +20,19 @@
<title>Configuration Options</title>
<variablelist xml:id="configuration-variable-list">
<xsl:for-each select="attrs">
<xsl:variable name="id" select="concat('opt-', str:replace(str:replace(str:replace(str:replace(attr[@name = 'name']/string/@value, '*', '_'), '&lt;', '_'), '>', '_'), ':', '_'))" />
<xsl:variable name="id" select="
concat('opt-',
str:replace(str:replace(str:replace(str:replace(str:replace(str:replace(str:replace(
attr[@name = 'name']/string/@value,
'*', '_'),
'&lt;', '_'),
' ', '_'),
'>', '_'),
'[', '_'),
']', '_'),
':', '_')
)
" />
<varlistentry>
<term xlink:href="#{$id}">
<xsl:attribute name="xml:id"><xsl:value-of select="$id"/></xsl:attribute>

Loading…
Cancel
Save