nixos/make-options-doc: make whitespace more md-compatible
markdown-it-py creates different whitespace leaders/trailers than are currently emitted, and when we convert examples and defaults to render via markdown the spacing will change too. this has no effect on rendered output.
This commit is contained in:
parent
d1aa187c0e
commit
2bd8129a47
|
@ -73,7 +73,7 @@ class Renderer(mistune.renderers.BaseRenderer):
|
||||||
return f"<literal>{escape(text)}</literal>"
|
return f"<literal>{escape(text)}</literal>"
|
||||||
def block_code(self, text, info=None):
|
def block_code(self, text, info=None):
|
||||||
info = f" language={quoteattr(info)}" if info is not None else ""
|
info = f" language={quoteattr(info)}" if info is not None else ""
|
||||||
return f"<programlisting{info}>\n{escape(text)}</programlisting>"
|
return f"<programlisting{info}>{escape(text)}</programlisting>"
|
||||||
def link(self, link, text=None, title=None):
|
def link(self, link, text=None, title=None):
|
||||||
tag = "link"
|
tag = "link"
|
||||||
if link[0:1] == '#':
|
if link[0:1] == '#':
|
||||||
|
|
|
@ -75,7 +75,8 @@
|
||||||
<xsl:if test="attr[@name = 'default']">
|
<xsl:if test="attr[@name = 'default']">
|
||||||
<para>
|
<para>
|
||||||
<emphasis>Default:</emphasis>
|
<emphasis>Default:</emphasis>
|
||||||
<xsl:text> </xsl:text>
|
<xsl:text>
|
||||||
|
</xsl:text>
|
||||||
<xsl:apply-templates select="attr[@name = 'default']/*" mode="top" />
|
<xsl:apply-templates select="attr[@name = 'default']/*" mode="top" />
|
||||||
</para>
|
</para>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
|
@ -83,7 +84,8 @@
|
||||||
<xsl:if test="attr[@name = 'example']">
|
<xsl:if test="attr[@name = 'example']">
|
||||||
<para>
|
<para>
|
||||||
<emphasis>Example:</emphasis>
|
<emphasis>Example:</emphasis>
|
||||||
<xsl:text> </xsl:text>
|
<xsl:text>
|
||||||
|
</xsl:text>
|
||||||
<xsl:apply-templates select="attr[@name = 'example']/*" mode="top" />
|
<xsl:apply-templates select="attr[@name = 'example']/*" mode="top" />
|
||||||
</para>
|
</para>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
|
@ -124,7 +126,8 @@
|
||||||
<xsl:template match="attrs[attr[@name = '_type' and string[@value = 'literalExpression']]]" mode = "top">
|
<xsl:template match="attrs[attr[@name = '_type' and string[@value = 'literalExpression']]]" mode = "top">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="contains(attr[@name = 'text']/string/@value, '
')">
|
<xsl:when test="contains(attr[@name = 'text']/string/@value, '
')">
|
||||||
<programlisting><xsl:value-of select="attr[@name = 'text']/string/@value" /></programlisting>
|
<programlisting><xsl:value-of select="attr[@name = 'text']/string/@value" /><xsl:text>
|
||||||
|
</xsl:text></programlisting>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<literal><xsl:value-of select="attr[@name = 'text']/string/@value" /></literal>
|
<literal><xsl:value-of select="attr[@name = 'text']/string/@value" /></literal>
|
||||||
|
|
Loading…
Reference in a new issue