doc: Split protocol description paragraphs properly
The xsl translation from the protocol xml to publican would create only one paragraph for all the text in a description. Make it generate one paragraph for each block of text separated by two consecutive line breaks instead. Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
This commit is contained in:
parent
0d77c5302e
commit
e78abc4892
|
@ -20,6 +20,25 @@
|
|||
</appendix>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Break text blocks separated by two new lines into paragraphs -->
|
||||
<xsl:template name="break">
|
||||
<xsl:param name="text" />
|
||||
<xsl:param name="linebreak" select="' '" />
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($text,$linebreak)">
|
||||
<para>
|
||||
<xsl:value-of select="substring-before($text,$linebreak)" />
|
||||
</para>
|
||||
<xsl:call-template name="break">
|
||||
<xsl:with-param name="text" select="substring-after($text,$linebreak)" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<para><xsl:value-of select="$text" /></para>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Copyright blurb -->
|
||||
<xsl:template match="copyright">
|
||||
<para>
|
||||
|
@ -41,9 +60,9 @@
|
|||
- <xsl:value-of select="description/@summary" />
|
||||
</xsl:if>
|
||||
</title>
|
||||
<para>
|
||||
<xsl:value-of select="description"/>
|
||||
</para>
|
||||
<xsl:call-template name="break">
|
||||
<xsl:with-param name="text" select="description" />
|
||||
</xsl:call-template>
|
||||
<xsl:if test="request">
|
||||
<section>
|
||||
<title>Requests provided by <xsl:value-of select="@name" /></title>
|
||||
|
@ -93,7 +112,9 @@
|
|||
- <xsl:value-of select="description/@summary" />
|
||||
</xsl:if>
|
||||
</title>
|
||||
<para><xsl:value-of select="description"/></para>
|
||||
<xsl:call-template name="break">
|
||||
<xsl:with-param name="text" select="description" />
|
||||
</xsl:call-template>
|
||||
<xsl:if test="arg">
|
||||
<variablelist>
|
||||
<title><xsl:value-of select="../@name"/>::<xsl:value-of select="@name" /> arguments</title>
|
||||
|
|
Loading…
Reference in New Issue
Block a user