mirror of
https://github.com/boostorg/boostbook.git
synced 2025-05-09 15:03:57 +00:00
Fix markup problems reported by Eric Niebler.
[SVN r62894]
This commit is contained in:
parent
ff74c39518
commit
bb67cd7547
@ -374,6 +374,14 @@
|
|||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="programlisting" mode="annotation">
|
||||||
|
<programlisting>
|
||||||
|
<xsl:apply-templates mode="annotation">
|
||||||
|
<xsl:with-param name="highlight" select="true()"/>
|
||||||
|
</xsl:apply-templates>
|
||||||
|
</programlisting>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="code" mode="annotation">
|
<xsl:template match="code" mode="annotation">
|
||||||
<computeroutput>
|
<computeroutput>
|
||||||
<xsl:apply-templates mode="annotation"/>
|
<xsl:apply-templates mode="annotation"/>
|
||||||
|
@ -654,16 +654,18 @@
|
|||||||
<xsl:call-template name="indent">
|
<xsl:call-template name="indent">
|
||||||
<xsl:with-param name="indentation" select="$indentation"/>
|
<xsl:with-param name="indentation" select="$indentation"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<emphasis>
|
<xsl:call-template name="highlight-comment">
|
||||||
<xsl:text>// </xsl:text>
|
<xsl:with-param name="text">
|
||||||
<xsl:call-template name="internal-link">
|
<xsl:text>// </xsl:text>
|
||||||
<xsl:with-param name="to">
|
<xsl:call-template name="internal-link">
|
||||||
<xsl:call-template name="generate.id"/>
|
<xsl:with-param name="to">
|
||||||
<xsl:text>construct-copy-destruct</xsl:text>
|
<xsl:call-template name="generate.id"/>
|
||||||
</xsl:with-param>
|
<xsl:text>construct-copy-destruct</xsl:text>
|
||||||
<xsl:with-param name="text" select="'construct/copy/destruct'"/>
|
</xsl:with-param>
|
||||||
</xsl:call-template>
|
<xsl:with-param name="text" select="'construct/copy/destruct'"/>
|
||||||
</emphasis>
|
</xsl:call-template>
|
||||||
|
</xsl:with-param>
|
||||||
|
</xsl:call-template>
|
||||||
<xsl:apply-templates select="constructor" mode="synopsis">
|
<xsl:apply-templates select="constructor" mode="synopsis">
|
||||||
<xsl:with-param name="indentation" select="$indentation"/>
|
<xsl:with-param name="indentation" select="$indentation"/>
|
||||||
</xsl:apply-templates>
|
</xsl:apply-templates>
|
||||||
@ -1083,15 +1085,17 @@
|
|||||||
<xsl:call-template name="indent">
|
<xsl:call-template name="indent">
|
||||||
<xsl:with-param name="indentation" select="$indentation"/>
|
<xsl:with-param name="indentation" select="$indentation"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<emphasis>
|
<xsl:call-template name="highlight-comment">
|
||||||
<xsl:text>// </xsl:text>
|
<xsl:with-param name="text">
|
||||||
<xsl:call-template name="internal-link">
|
<xsl:text>// </xsl:text>
|
||||||
<xsl:with-param name="to">
|
<xsl:call-template name="internal-link">
|
||||||
<xsl:call-template name="generate.id"/>
|
<xsl:with-param name="to">
|
||||||
</xsl:with-param>
|
<xsl:call-template name="generate.id"/>
|
||||||
<xsl:with-param name="text" select="string(@name)"/>
|
</xsl:with-param>
|
||||||
</xsl:call-template>
|
<xsl:with-param name="text" select="string(@name)"/>
|
||||||
</emphasis>
|
</xsl:call-template>
|
||||||
|
</xsl:with-param>
|
||||||
|
</xsl:call-template>
|
||||||
<xsl:apply-templates select="method|overloaded-method"
|
<xsl:apply-templates select="method|overloaded-method"
|
||||||
mode="synopsis">
|
mode="synopsis">
|
||||||
<xsl:with-param name="indentation" select="$indentation"/>
|
<xsl:with-param name="indentation" select="$indentation"/>
|
||||||
@ -1137,15 +1141,17 @@
|
|||||||
<xsl:call-template name="indent">
|
<xsl:call-template name="indent">
|
||||||
<xsl:with-param name="indentation" select="$indentation"/>
|
<xsl:with-param name="indentation" select="$indentation"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<emphasis>
|
<xsl:call-template name="highlight-comment">
|
||||||
<xsl:text>// </xsl:text>
|
<xsl:with-param name="text">
|
||||||
<xsl:call-template name="internal-link">
|
<xsl:text>// </xsl:text>
|
||||||
<xsl:with-param name="to">
|
<xsl:call-template name="internal-link">
|
||||||
<xsl:call-template name="generate.id"/>
|
<xsl:with-param name="to">
|
||||||
</xsl:with-param>
|
<xsl:call-template name="generate.id"/>
|
||||||
<xsl:with-param name="text" select="string(@name)"/>
|
</xsl:with-param>
|
||||||
</xsl:call-template>
|
<xsl:with-param name="text" select="string(@name)"/>
|
||||||
</emphasis>
|
</xsl:call-template>
|
||||||
|
</xsl:with-param>
|
||||||
|
</xsl:call-template>
|
||||||
<xsl:apply-templates select="function|overloaded-function" mode="synopsis">
|
<xsl:apply-templates select="function|overloaded-function" mode="synopsis">
|
||||||
<xsl:with-param name="indentation" select="$indentation"/>
|
<xsl:with-param name="indentation" select="$indentation"/>
|
||||||
</xsl:apply-templates>
|
</xsl:apply-templates>
|
||||||
|
@ -98,9 +98,71 @@
|
|||||||
<xsl:template match="para|section" mode="synopsis"/>
|
<xsl:template match="para|section" mode="synopsis"/>
|
||||||
<xsl:template match="para|section" mode="reference"/>
|
<xsl:template match="para|section" mode="reference"/>
|
||||||
|
|
||||||
|
<xsl:template name="find-wrap-point">
|
||||||
|
<xsl:param name="text"/>
|
||||||
|
<xsl:param name="prefix"/>
|
||||||
|
<xsl:param name="result" select="0"/>
|
||||||
|
<xsl:param name="default" select="$max-columns - string-length($prefix)"/>
|
||||||
|
<xsl:variable name="s" select="substring($text, 2)"/>
|
||||||
|
<xsl:variable name="candidate">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="contains($s, ' ')">
|
||||||
|
<xsl:value-of select="string-length(substring-before($s, ' ')) + 1"/>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:value-of select="string-length($text)"/>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:variable>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="string-length($prefix) + $result + $candidate <= $max-columns">
|
||||||
|
<xsl:call-template name="find-wrap-point">
|
||||||
|
<xsl:with-param name="text" select="substring($text, $candidate + 1)"/>
|
||||||
|
<xsl:with-param name="prefix" select="$prefix"/>
|
||||||
|
<xsl:with-param name="result" select="$result + $candidate"/>
|
||||||
|
<xsl:with-param name="default" select="$result + $candidate"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:value-of select="$default"/>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template name="wrap-comment">
|
||||||
|
<xsl:param name="prefix"/>
|
||||||
|
<xsl:param name="text"/>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="string-length($prefix) + string-length($text) <= $max-columns">
|
||||||
|
<xsl:value-of select="$text"/>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:variable name="size">
|
||||||
|
<xsl:call-template name="find-wrap-point">
|
||||||
|
<xsl:with-param name="prefix" select="$prefix"/>
|
||||||
|
<xsl:with-param name="text" select="$text"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:variable>
|
||||||
|
<xsl:value-of select="substring($text, 1, $size)"/>
|
||||||
|
<xsl:text> </xsl:text>
|
||||||
|
<xsl:value-of select="$prefix"/>
|
||||||
|
<xsl:call-template name="wrap-comment">
|
||||||
|
<xsl:with-param name="prefix" select="$prefix"/>
|
||||||
|
<xsl:with-param name="text" select="normalize-space(substring($text, $size + 1))"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Comment mode tries to wipe out any extra spacing in the output -->
|
<!-- Comment mode tries to wipe out any extra spacing in the output -->
|
||||||
<xsl:template match="purpose" mode="comment">
|
<xsl:template match="purpose" mode="comment">
|
||||||
<xsl:apply-templates mode="comment"/>
|
<xsl:param name="wrap" select="false()"/>
|
||||||
|
<xsl:param name="prefix"/>
|
||||||
|
<xsl:apply-templates mode="comment">
|
||||||
|
<xsl:with-param name="wrap"
|
||||||
|
select="$wrap and count(*) = 0 and count(text()) = 1"/>
|
||||||
|
<xsl:with-param name="prefix" select="$prefix"/>
|
||||||
|
</xsl:apply-templates>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="simpara|para" mode="comment">
|
<xsl:template match="simpara|para" mode="comment">
|
||||||
@ -108,7 +170,20 @@
|
|||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="text()" mode="comment">
|
<xsl:template match="text()" mode="comment">
|
||||||
<xsl:value-of select="."/>
|
<xsl:param name="wrap" select="false()"/>
|
||||||
|
<xsl:param name="prefix"/>
|
||||||
|
<xsl:variable name="stripped" select="normalize-space(.)"/>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="$wrap">
|
||||||
|
<xsl:call-template name="wrap-comment">
|
||||||
|
<xsl:with-param name="prefix" select="$prefix"/>
|
||||||
|
<xsl:with-param name="text" select="$stripped"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:value-of select="."/>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="*" mode="comment">
|
<xsl:template match="*" mode="comment">
|
||||||
|
@ -75,11 +75,11 @@
|
|||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="$boost.syntax.highlight='1'">
|
<xsl:when test="$boost.syntax.highlight='1'">
|
||||||
<phrase role="comment">
|
<phrase role="comment">
|
||||||
<xsl:value-of select="$text"/>
|
<xsl:copy-of select="$text"/>
|
||||||
</phrase>
|
</phrase>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:value-of select="$text"/>
|
<xsl:copy-of select="$text"/>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
57
xsl/type.xsl
57
xsl/type.xsl
@ -764,26 +764,28 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
|
|||||||
<xsl:call-template name="indent">
|
<xsl:call-template name="indent">
|
||||||
<xsl:with-param name="indentation" select="$indentation + 2"/>
|
<xsl:with-param name="indentation" select="$indentation + 2"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<emphasis>
|
<xsl:call-template name="highlight-comment">
|
||||||
<xsl:text>// </xsl:text>
|
<xsl:with-param name="text">
|
||||||
<!-- True if there are any non-compacted typedefs -->
|
<xsl:text>// </xsl:text>
|
||||||
<xsl:variable name="have-typedef-references"
|
<!-- True if there are any non-compacted typedefs -->
|
||||||
select="typedef and ((typedef/para|typedef/description) or ($boost.compact.typedef='0'))"/>
|
<xsl:variable name="have-typedef-references"
|
||||||
<xsl:choose>
|
select="typedef and ((typedef/para|typedef/description) or ($boost.compact.typedef='0'))"/>
|
||||||
<xsl:when test="$have-typedef-references">
|
<xsl:choose>
|
||||||
<xsl:call-template name="internal-link">
|
<xsl:when test="$have-typedef-references">
|
||||||
<xsl:with-param name="to">
|
<xsl:call-template name="internal-link">
|
||||||
<xsl:call-template name="generate.id"/>
|
<xsl:with-param name="to">
|
||||||
<xsl:text>types</xsl:text>
|
<xsl:call-template name="generate.id"/>
|
||||||
</xsl:with-param>
|
<xsl:text>types</xsl:text>
|
||||||
<xsl:with-param name="text" select="'types'"/>
|
</xsl:with-param>
|
||||||
</xsl:call-template>
|
<xsl:with-param name="text" select="'types'"/>
|
||||||
</xsl:when>
|
</xsl:call-template>
|
||||||
<xsl:otherwise>
|
</xsl:when>
|
||||||
<xsl:text>types</xsl:text>
|
<xsl:otherwise>
|
||||||
</xsl:otherwise>
|
<xsl:text>types</xsl:text>
|
||||||
</xsl:choose>
|
</xsl:otherwise>
|
||||||
</emphasis>
|
</xsl:choose>
|
||||||
|
</xsl:with-param>
|
||||||
|
</xsl:call-template>
|
||||||
|
|
||||||
<xsl:variable name="max-type-length">
|
<xsl:variable name="max-type-length">
|
||||||
<xsl:call-template name="find-max-type-length"/>
|
<xsl:call-template name="find-max-type-length"/>
|
||||||
@ -912,15 +914,22 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
|
|||||||
comment. -->
|
comment. -->
|
||||||
<xsl:if test="purpose">
|
<xsl:if test="purpose">
|
||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
<xsl:call-template name="indent">
|
<xsl:variable name="spaces">
|
||||||
<xsl:with-param name="indentation" select="$indentation"/>
|
<xsl:call-template name="indent">
|
||||||
</xsl:call-template>
|
<xsl:with-param name="indentation" select="$indentation"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:variable>
|
||||||
|
<xsl:copy-of select="$spaces"/>
|
||||||
<xsl:call-template name="highlight-comment">
|
<xsl:call-template name="highlight-comment">
|
||||||
<xsl:with-param name="text">
|
<xsl:with-param name="text">
|
||||||
<xsl:text>// </xsl:text>
|
<xsl:text>// </xsl:text>
|
||||||
<xsl:apply-templates select="purpose" mode="comment"/>
|
<xsl:apply-templates select="purpose" mode="comment">
|
||||||
|
<xsl:with-param name="wrap" select="true()"/>
|
||||||
|
<xsl:with-param name="prefix" select="concat($spaces, '// ')"/>
|
||||||
|
</xsl:apply-templates>
|
||||||
</xsl:with-param>
|
</xsl:with-param>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
|
<xsl:text> </xsl:text>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user