nixos/make-options-doc: rearrange paras in related packages/defaults/examples

this mirrors what we will be able to create with markdown. no change to
rendered outputs.
This commit is contained in:
pennae 2023-01-19 00:17:05 +01:00 committed by pennae
parent 3a5f1ae029
commit c93e5dde67
2 changed files with 7 additions and 5 deletions

View file

@ -220,8 +220,11 @@ def convertMD(options: Dict[str, Any]) -> str:
# inline literals need a space to separate ticks from content, code blocks
# need newlines. inline literals need one extra tick, code blocks need three.
ticks, sep = ('`' * (longest + (3 if multiline else 1)), '\n' if multiline else ' ')
docbook = convertString(name, f"*{key.capitalize()}:*\n{ticks}{sep}{code}{sep}{ticks}")
option[rendered] = f"<para>{docbook}</para>"
docbook = convertString(name, f"{ticks}{sep}{code}{sep}{ticks}")
if multiline:
option[rendered] = f"<para><emphasis>{key.capitalize()}:</emphasis></para> {docbook}"
else:
option[rendered] = f"<para><emphasis>{key.capitalize()}:</emphasis> {docbook}</para>"
elif optionIs(option, key, 'literalDocBook'):
option[rendered] = f"<para><emphasis>{key.capitalize()}:</emphasis> {option[key]['text']}</para>"
elif key in option:

View file

@ -85,10 +85,9 @@
<xsl:if test="attr[@name = 'relatedPackages']">
<para>
<emphasis>Related packages:</emphasis>
<xsl:text> </xsl:text>
<xsl:value-of disable-output-escaping="yes"
select="attr[@name = 'relatedPackages']/string/@value" />
</para>
<xsl:value-of disable-output-escaping="yes"
select="attr[@name = 'relatedPackages']/string/@value" />
</xsl:if>
<xsl:if test="count(attr[@name = 'declarations']/list/*) != 0">