apply various patches from Julio M. Merino Vidal

[SVN r37358]
This commit is contained in:
Eric Niebler 2007-04-04 22:52:17 +00:00
parent f9d3ce76c5
commit bd100bb86b
2 changed files with 195 additions and 13 deletions

View File

@ -46,6 +46,7 @@
<xsl:key name="compounds-by-kind" match="compounddef" use="@kind"/>
<xsl:key name="compounds-by-id" match="compounddef" use="@id"/>
<xsl:key name="members-by-id" match="memberdef" use="@id" />
<xsl:strip-space elements="briefdescription detaileddescription"/>
@ -412,6 +413,16 @@ Cannot handle compounddef with kind=<xsl:value-of select="@kind"/>
</xsl:if>
</xsl:template>
<xsl:template match="sectiondef" mode="toplevel">
<xsl:param name="in-file" select="''"/>
<xsl:apply-templates mode="toplevel"
select="memberdef[generate-id() =
generate-id(key('members-by-id', @id))]">
<xsl:with-param name="in-file" select="$in-file"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="memberdef" mode="toplevel">
<xsl:param name="with-namespace-refs"/>
<xsl:param name="in-file"/>
@ -447,6 +458,19 @@ Cannot handle compounddef with kind=<xsl:value-of select="@kind"/>
<xsl:apply-templates select="detaileddescription" mode="passthrough"/>
</macro>
</xsl:when>
<xsl:when test="@kind='function'">
<xsl:call-template name="function" />
</xsl:when>
<xsl:when test="@kind='typedef'">
<xsl:call-template name="typedef" />
</xsl:when>
<xsl:otherwise>
<xsl:message>Cannot handle toplevel memberdef element with
kind=<xsl:value-of select="@kind"/></xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
@ -665,6 +689,12 @@ Cannot handle compounddef with kind=<xsl:value-of select="@kind"/>
<xsl:when test="@kind='user-defined'">
<xsl:apply-templates/>
</xsl:when>
<xsl:when test="@kind=''">
<xsl:apply-templates select="memberdef[generate-id() =
generate-id(key('members-by-id', @id))]">
<xsl:with-param name="in-file" select="$in-file"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:message>
Cannot handle sectiondef with kind=<xsl:value-of select="@kind"/>
@ -1327,4 +1357,61 @@ Cannot handle memberdef element with kind=<xsl:value-of select="@kind"/>
<xsl:apply-templates select="*|text()" mode="passthrough"/>
</xsl:template>
<!--
Eric Niebler: 4-4-2007
Here is some half-baked support for LaTeX formulas in
Doxygen comments. Doxygen doesn't generate the PNG files
when outputting XML. In order to use this code, you must
run Doxygen first to generate HTML (and the PNG files for
the formulas), then copy the PNG files into the images/
directory, and then build the docs with bjam. Commented
out until something better comes along.
<xsl:template match="formula" mode="passthrough">
<xsl:choose>
<xsl:when test="substring(*|text(), 1, 2) = '\['">
<equation>
<alt>
<xsl:value-of select="*|text()"/>
</alt>
<mediaobject>
<imageobject role="html">
<imagedata format="PNG" align="center">
<xsl:attribute name="fileref">
<xsl:value-of select="concat(concat('images/form_', @id), '.png')"/>
</xsl:attribute>
</imagedata>
</imageobject>
<textobject role="tex">
<phrase>
<xsl:value-of select="*|text()"/>
</phrase>
</textobject>
</mediaobject>
</equation>
</xsl:when>
<xsl:otherwise>
<inlineequation>
<alt>
<xsl:value-of select="*|text()"/>
</alt>
<inlinemediaobject>
<imageobject role="html">
<imagedata format="PNG">
<xsl:attribute name="fileref">
<xsl:value-of select="concat(concat('images/form_', @id), '.png')"/>
</xsl:attribute>
</imagedata>
</imageobject>
<textobject role="tex">
<phrase>
<xsl:value-of select="*|text()"/>
</phrase>
</textobject>
</inlinemediaobject>
</inlineequation>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-->
</xsl:stylesheet>

View File

@ -20,6 +20,11 @@
separate refentry element for the enum. -->
<xsl:param name="boost.compact.enum">1</xsl:param>
<!-- When true, the stylesheet will emit compact definitions of
typedefs when the typedef does not have any detailed
description. -->
<xsl:param name="boost.compact.typedef">1</xsl:param>
<xsl:template match="class|struct|union" mode="generate.id">
<xsl:call-template name="fully-qualified-name">
<xsl:with-param name="node" select="."/>
@ -27,6 +32,13 @@
</xsl:call-template>
</xsl:template>
<xsl:template match="typedef" mode="generate.id">
<xsl:call-template name="fully-qualified-name">
<xsl:with-param name="node" select="."/>
<xsl:with-param name="separator" select="'.'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="enum" mode="generate.id">
<xsl:call-template name="fully-qualified-name">
<xsl:with-param name="node" select="."/>
@ -193,10 +205,38 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
<!-- Emit a typedef synopsis -->
<xsl:template name="type.typedef.display.aligned">
<xsl:param name="compact"/>
<xsl:param name="indentation"/>
<xsl:param name="is-reference"/>
<xsl:param name="max-type-length"/>
<xsl:param name="max-name-length"/>
<!-- What type of link the typedef name should have. This shall
be one of 'anchor' (the typedef output will be the target of
links), 'link' (the typedef output will link to a definition), or
'none' (the typedef output will not be either a link or a link
target) -->
<xsl:param name="link-type">
<xsl:choose>
<xsl:when test="$is-reference">
<xsl:text>anchor</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>link</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<!-- The id we should link to or anchor as -->
<xsl:param name="link-to">
<xsl:call-template name="generate.id"/>
</xsl:param>
<!-- The id we should link to or anchor as -->
<xsl:param name="typedef-name">
<xsl:value-of select="@name"/>
</xsl:param>
<!-- Padding for the typedef types -->
<xsl:variable name="type-padding">
<xsl:call-template name="indent">
@ -280,11 +320,18 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
1, $max-name-length)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(' ',@name,';')"/>
<xsl:text> </xsl:text>
<xsl:call-template name="link-or-anchor">
<xsl:with-param name="to" select="$link-to"/>
<xsl:with-param name="text" select="$typedef-name"/>
<xsl:with-param name="link-type" select="$link-type"/>
<xsl:with-param name="highlight" select="true()"/>
</xsl:call-template>
<xsl:text>;</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="purpose">
<xsl:if test="$compact and purpose">
<xsl:text> </xsl:text>
<xsl:call-template name="highlight-comment">
<xsl:with-param name="text">
@ -302,20 +349,68 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
<xsl:param name="max-type-length" select="0"/>
<xsl:param name="max-name-length" select="0"/>
<!-- Spacing -->
<xsl:if test="not (local-name(preceding-sibling::*[position()=1])=local-name(.)) and (position() &gt; 1)">
<xsl:text>&#10;</xsl:text>
</xsl:if>
<!-- True if we should compact this typedef -->
<xsl:variable name="compact"
select="not (para|description) and ($boost.compact.typedef='1')"/>
<xsl:call-template name="type.typedef.display.aligned">
<xsl:with-param name="indentation" select="$indentation"/>
<xsl:with-param name="max-type-length" select="$max-type-length"/>
<xsl:with-param name="max-name-length" select="$max-name-length"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="$compact">
<!-- Spacing -->
<xsl:if test="not (local-name(preceding-sibling::*[position()=1])=local-name(.)) and (position() &gt; 1)">
<xsl:text>&#10;</xsl:text>
</xsl:if>
<xsl:call-template name="type.typedef.display.aligned">
<xsl:with-param name="compact" select="$compact"/>
<xsl:with-param name="indentation" select="$indentation"/>
<xsl:with-param name="is-reference" select="true()"/>
<xsl:with-param name="max-type-length" select="$max-type-length"/>
<xsl:with-param name="max-name-length" select="$max-name-length"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="type.typedef.display.aligned">
<xsl:with-param name="compact" select="$compact"/>
<xsl:with-param name="indentation" select="$indentation"/>
<xsl:with-param name="is-reference" select="false()"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- TBD: Implement this -->
<xsl:template match="typedef" mode="reference"/>
<!-- Emit a typedef reference entry -->
<xsl:template match="typedef" mode="reference">
<!-- True if this typedef was compacted -->
<xsl:variable name="compact"
select="not (para|description) and ($boost.compact.typedef='1')"/>
<xsl:if test="not ($compact)">
<xsl:call-template name="reference-documentation">
<xsl:with-param name="refname" select="@name"/>
<xsl:with-param name="purpose" select="purpose/*|purpose/text()"/>
<xsl:with-param name="anchor">
<xsl:call-template name="generate.id"/>
</xsl:with-param>
<xsl:with-param name="name">
<xsl:text>Type definition </xsl:text>
<xsl:call-template name="monospaced">
<xsl:with-param name="text" select="@name"/>
</xsl:call-template>
</xsl:with-param>
<xsl:with-param name="synopsis">
<xsl:call-template name="type.typedef.display.aligned">
<xsl:with-param name="compact" select="false()"/>
<xsl:with-param name="indentation" select="0"/>
<xsl:with-param name="is-reference" select="true()"/>
<xsl:with-param name="link-type" select="'none'"/>
</xsl:call-template>
</xsl:with-param>
<xsl:with-param name="text">
<xsl:apply-templates select="description"/>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- Emit a list of static constants -->
<xsl:template match="static-constant" mode="synopsis">