doxygen/doxygen2boostbook.xsl: Don't strip <para> elements from within

(generated) <purpose> elements; just make them <simpara> elements.

annotation.xsl: Added a "purpose" mode that strips paragraph elements
for printing the purpose in a comment

function.xsl: Don't compact methods or overloaded methods.


[SVN r20499]
This commit is contained in:
Douglas Gregor 2003-10-27 01:13:34 +00:00
parent c1cdd4526f
commit 075fcc3cbd
3 changed files with 49 additions and 37 deletions

View File

@ -268,4 +268,18 @@
</xsl:apply-templates> </xsl:apply-templates>
</xsl:element> </xsl:element>
</xsl:template> </xsl:template>
<!-- The "purpose" mode strips simpara/para elements so that we can
place the resulting text into a comment in the synopsis. -->
<xsl:template match="para|simpara" mode="purpose">
<xsl:apply-templates mode="annotation"/>
</xsl:template>
<xsl:template match="*" mode="purpose">
<xsl:apply-templates select="." mode="annotation"/>
</xsl:template>
<xsl:template match="text()" mode="purpose">
<xsl:apply-templates select="." mode="annotation"/>
</xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

View File

@ -1147,7 +1147,8 @@ Cannot handle memberdef element with kind=<xsl:value-of select="@kind"/>
<xsl:apply-templates select="." mode="passthrough"/> <xsl:apply-templates select="." mode="passthrough"/>
</xsl:template> </xsl:template>
<!-- Remove top-level "para" and elements in the purpose --> <!-- Replace top-level "para" elements with "simpara" elements in
the purpose -->
<xsl:template match="*" mode="purpose"> <xsl:template match="*" mode="purpose">
<xsl:apply-templates mode="passthrough"/> <xsl:apply-templates mode="passthrough"/>
</xsl:template> </xsl:template>
@ -1157,7 +1158,9 @@ Cannot handle memberdef element with kind=<xsl:value-of select="@kind"/>
</xsl:template> </xsl:template>
<xsl:template match="para" mode="purpose"> <xsl:template match="para" mode="purpose">
<xsl:apply-templates select="*|text()" mode="passthrough"/> <simpara>
<xsl:apply-templates select="*|text()" mode="passthrough"/>
</simpara>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

View File

@ -468,7 +468,8 @@
<xsl:variable name="compact" <xsl:variable name="compact"
select="not (para|description|requires|effects|postconditions|returns| select="not (para|description|requires|effects|postconditions|returns|
throws|complexity|notes|rationale) and throws|complexity|notes|rationale) and
($boost.compact.function='1')"/> ($boost.compact.function='1') and
not (local-name(.)='method')"/>
<xsl:choose> <xsl:choose>
<xsl:when test="$compact"> <xsl:when test="$compact">
@ -484,7 +485,7 @@
<xsl:with-param name="text"> <xsl:with-param name="text">
<xsl:text>// </xsl:text> <xsl:text>// </xsl:text>
<xsl:apply-templates select="purpose/*|purpose/text()" <xsl:apply-templates select="purpose/*|purpose/text()"
mode="annotation"/> mode="purpose"/>
</xsl:with-param> </xsl:with-param>
</xsl:call-template> </xsl:call-template>
</xsl:if> </xsl:if>
@ -512,7 +513,8 @@
<xsl:variable name="compact" <xsl:variable name="compact"
select="not (para|description|requires|effects|postconditions|returns| select="not (para|description|requires|effects|postconditions|returns|
throws|complexity|notes|rationale) and throws|complexity|notes|rationale) and
($boost.compact.function='1')"/> ($boost.compact.function='1') and
not (local-name(.)='overloaded-method')"/>
<xsl:choose> <xsl:choose>
<xsl:when test="$compact"> <xsl:when test="$compact">
@ -898,7 +900,8 @@
<xsl:variable name="compact" <xsl:variable name="compact"
select="not (para|description|requires|effects|postconditions|returns| select="not (para|description|requires|effects|postconditions|returns|
throws|complexity|notes|rationale) and throws|complexity|notes|rationale) and
($boost.compact.function='1')"/> ($boost.compact.function='1') and
not (local-name(.)='method')"/>
<xsl:if test="not ($compact)"> <xsl:if test="not ($compact)">
<xsl:call-template name="function.documentation"> <xsl:call-template name="function.documentation">
@ -1052,37 +1055,29 @@
<xsl:template match="overloaded-method" mode="reference"> <xsl:template match="overloaded-method" mode="reference">
<xsl:variable name="name" select="@name"/> <xsl:variable name="name" select="@name"/>
<!-- True if we should compact this function --> <xsl:call-template name="function.documentation">
<xsl:variable name="compact" <xsl:with-param name="text">
select="not (para|description|requires|effects|postconditions|returns| <para>
throws|complexity|notes|rationale) and <xsl:attribute name="id">
($boost.compact.function='1')"/> <xsl:call-template name="generate.id"/>
</xsl:attribute>
<xsl:if test="not ($compact)">
<xsl:call-template name="function.documentation"> <xsl:call-template name="preformatted">
<xsl:with-param name="text"> <xsl:with-param name="text">
<para> <xsl:for-each select="signature">
<xsl:attribute name="id"> <xsl:call-template name="function">
<xsl:call-template name="generate.id"/> <xsl:with-param name="indentation" select="0"/>
</xsl:attribute> <xsl:with-param name="is-reference" select="true()"/>
<xsl:with-param name="name" select="$name"/>
<xsl:call-template name="preformatted"> <xsl:with-param name="standalone" select="true()"/>
<xsl:with-param name="text"> </xsl:call-template>
<xsl:for-each select="signature"> </xsl:for-each>
<xsl:call-template name="function"> </xsl:with-param>
<xsl:with-param name="indentation" select="0"/> </xsl:call-template>
<xsl:with-param name="is-reference" select="true()"/> </para>
<xsl:with-param name="name" select="$name"/> <xsl:call-template name="function-requirements"/>
<xsl:with-param name="standalone" select="true()"/> </xsl:with-param>
</xsl:call-template> </xsl:call-template>
</xsl:for-each>
</xsl:with-param>
</xsl:call-template>
</para>
<xsl:call-template name="function-requirements"/>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template> </xsl:template>
<!-- Group member functions together under a category name (synopsis)--> <!-- Group member functions together under a category name (synopsis)-->