forked from mirrors/nixpkgs
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>"
|
||||
def block_code(self, text, info=None):
|
||||
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):
|
||||
tag = "link"
|
||||
if link[0:1] == '#':
|
||||
|
|
|
@ -75,7 +75,8 @@
|
|||
<xsl:if test="attr[@name = 'default']">
|
||||
<para>
|
||||
<emphasis>Default:</emphasis>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:text>
|
||||
</xsl:text>
|
||||
<xsl:apply-templates select="attr[@name = 'default']/*" mode="top" />
|
||||
</para>
|
||||
</xsl:if>
|
||||
|
@ -83,7 +84,8 @@
|
|||
<xsl:if test="attr[@name = 'example']">
|
||||
<para>
|
||||
<emphasis>Example:</emphasis>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:text>
|
||||
</xsl:text>
|
||||
<xsl:apply-templates select="attr[@name = 'example']/*" mode="top" />
|
||||
</para>
|
||||
</xsl:if>
|
||||
|
@ -124,7 +126,8 @@
|
|||
<xsl:template match="attrs[attr[@name = '_type' and string[@value = 'literalExpression']]]" mode = "top">
|
||||
<xsl:choose>
|
||||
<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:otherwise>
|
||||
<literal><xsl:value-of select="attr[@name = 'text']/string/@value" /></literal>
|
||||
|
|
Loading…
Reference in a new issue