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

This commit is contained in:
Robert Hensing 2022-05-13 09:00:06 +02:00
parent 06da97fc3a
commit 062bc5e74a
2 changed files with 14 additions and 2 deletions

View file

@ -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; };

View file

@ -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>