support for LaTeX formulas in Doxygen comments

[SVN r42615]
This commit is contained in:
Eric Niebler 2008-01-08 17:42:20 +00:00
parent 140de3e0c0
commit 3b8ad2b187

View File

@ -37,11 +37,14 @@
<!-- The title that will be used for the BoostBook library reference emitted. <!-- The title that will be used for the BoostBook library reference emitted.
If left blank, BoostBook will assign a default title. --> If left blank, BoostBook will assign a default title. -->
<xsl:param name="boost.doxygen.reftitle" select="''"/> <xsl:param name="boost.doxygen.reftitle" select="''"/>
<!-- The id used for the library-reference. By default, it is the normalized <!-- The id used for the library-reference. By default, it is the normalized
form of the reftitle. --> form of the reftitle. -->
<xsl:param name="boost.doxygen.refid" select="''"/> <xsl:param name="boost.doxygen.refid" select="''"/>
<!-- The directory into which png files corresponding to LaTeX formulas will be found. -->
<xsl:param name="boost.doxygen.formuladir" select="'images/'"/>
<xsl:output method="xml" indent="no" standalone="yes"/> <xsl:output method="xml" indent="no" standalone="yes"/>
<xsl:key name="compounds-by-kind" match="compounddef" use="@kind"/> <xsl:key name="compounds-by-kind" match="compounddef" use="@kind"/>
@ -1358,18 +1361,25 @@ Cannot handle memberdef element with kind=<xsl:value-of select="@kind"/>
</xsl:template> </xsl:template>
<!-- <!--
Eric Niebler: 4-4-2007 Eric Niebler: Jan-8-2008
Here is some half-baked support for LaTeX formulas in Here is some 3/4-baked support for LaTeX formulas in
Doxygen comments. Doxygen doesn't generate the PNG files Doxygen comments. Doxygen doesn't generate the PNG files
when outputting XML. In order to use this code, you must when outputting XML. In order to use this code, you must
run Doxygen first to generate HTML (and the PNG files for run Doxygen first to generate HTML (and the PNG files for
the formulas), then copy the PNG files into the images/ the formulas). You can do this in a Jamfile with
directory, and then build the docs with bjam. Commented "doxygen foo.html : <sources, etc...> ; ", where the ".html"
out until something better comes along. is significant. Then the png files should be copied into the
images/ directory (or another place relative to the html/
directory, as specified by $boost.doxygen.formuladir XSL
parameter). This can be done with a custom action in a
Jamfile. Finally, the docs can be built as normal.
See libs/accumulators/doc/Jamfile.v2 for a working example.
-->
<xsl:template match="formula" mode="passthrough"> <xsl:template match="formula" mode="passthrough">
<xsl:choose> <xsl:choose>
<xsl:when test="substring(*|text(), 1, 2) = '\['"> <xsl:when test="substring(*|text(), 1, 2) = '\['">
<equation> <equation>
<title/>
<alt> <alt>
<xsl:value-of select="*|text()"/> <xsl:value-of select="*|text()"/>
</alt> </alt>
@ -1377,7 +1387,7 @@ Cannot handle memberdef element with kind=<xsl:value-of select="@kind"/>
<imageobject role="html"> <imageobject role="html">
<imagedata format="PNG" align="center"> <imagedata format="PNG" align="center">
<xsl:attribute name="fileref"> <xsl:attribute name="fileref">
<xsl:value-of select="concat(concat('images/form_', @id), '.png')"/> <xsl:value-of select="concat(concat(concat($boost.doxygen.formuladir, 'form_'), @id), '.png')"/>
</xsl:attribute> </xsl:attribute>
</imagedata> </imagedata>
</imageobject> </imageobject>
@ -1398,7 +1408,7 @@ Cannot handle memberdef element with kind=<xsl:value-of select="@kind"/>
<imageobject role="html"> <imageobject role="html">
<imagedata format="PNG"> <imagedata format="PNG">
<xsl:attribute name="fileref"> <xsl:attribute name="fileref">
<xsl:value-of select="concat(concat('images/form_', @id), '.png')"/> <xsl:value-of select="concat(concat(concat($boost.doxygen.formuladir, 'form_'), @id), '.png')"/>
</xsl:attribute> </xsl:attribute>
</imagedata> </imagedata>
</imageobject> </imageobject>
@ -1412,6 +1422,4 @@ Cannot handle memberdef element with kind=<xsl:value-of select="@kind"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
-->
</xsl:stylesheet> </xsl:stylesheet>