mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	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
					
				
					 1 changed files with 25 additions and 4 deletions
				
			
		| 
						 | 
					@ -20,6 +20,25 @@
 | 
				
			||||||
  </appendix>
 | 
					  </appendix>
 | 
				
			||||||
</xsl:template>
 | 
					</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 -->
 | 
					<!-- Copyright blurb -->
 | 
				
			||||||
<xsl:template match="copyright">
 | 
					<xsl:template match="copyright">
 | 
				
			||||||
  <para>
 | 
					  <para>
 | 
				
			||||||
| 
						 | 
					@ -41,9 +60,9 @@
 | 
				
			||||||
	- <xsl:value-of select="description/@summary" />
 | 
						- <xsl:value-of select="description/@summary" />
 | 
				
			||||||
      </xsl:if>
 | 
					      </xsl:if>
 | 
				
			||||||
    </title>
 | 
					    </title>
 | 
				
			||||||
    <para>
 | 
					    <xsl:call-template name="break">
 | 
				
			||||||
      <xsl:value-of select="description"/>
 | 
					      <xsl:with-param name="text" select="description" />
 | 
				
			||||||
    </para>
 | 
					    </xsl:call-template>
 | 
				
			||||||
    <xsl:if test="request">
 | 
					    <xsl:if test="request">
 | 
				
			||||||
      <section>
 | 
					      <section>
 | 
				
			||||||
        <title>Requests provided by <xsl:value-of select="@name" /></title>
 | 
					        <title>Requests provided by <xsl:value-of select="@name" /></title>
 | 
				
			||||||
| 
						 | 
					@ -93,7 +112,9 @@
 | 
				
			||||||
        - <xsl:value-of select="description/@summary" />
 | 
					        - <xsl:value-of select="description/@summary" />
 | 
				
			||||||
      </xsl:if>
 | 
					      </xsl:if>
 | 
				
			||||||
    </title>
 | 
					    </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">
 | 
					    <xsl:if test="arg">
 | 
				
			||||||
      <variablelist>
 | 
					      <variablelist>
 | 
				
			||||||
        <title><xsl:value-of select="../@name"/>::<xsl:value-of select="@name" /> arguments</title>
 | 
					        <title><xsl:value-of select="../@name"/>::<xsl:value-of select="@name" /> arguments</title>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue