mirror of
https://github.com/boostorg/boostbook.git
synced 2025-05-09 02:43:58 +00:00
Better handling of tparam.
[SVN r74982]
This commit is contained in:
parent
130a1bd0a8
commit
3d2c61d79b
@ -3,7 +3,8 @@
|
||||
# Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
import doxygen ;
|
||||
using boostbook ;
|
||||
using doxygen ;
|
||||
import os ;
|
||||
|
||||
doxygen autodoc
|
||||
|
@ -22,4 +22,8 @@ Line 1<sbr/>
|
||||
|
||||
This is a test function. <classname alt="example::example">Link to class</classname> <classname alt="example::example_template">Link to class template</classname> <note><para>This is a note.</para></note>
|
||||
<para><emphasis role="bold">See Also:</emphasis><para><classname alt="example::example">example::example</classname> and <classname alt="example::example_template">example_template</classname> </para></para>
|
||||
</para></description><requires><para>i > j</para></requires><returns><para>The answer </para></returns></function></namespace><macro name="EXAMPLE" kind="functionlike"><macro-parameter name="m"/><purpose>Documentation for macro example. </purpose></macro></header></library-reference>
|
||||
</para></description><requires><para>i > j</para></requires><returns><para>The answer </para></returns></function><function name="namespace_func_template"><type>void</type><template>
|
||||
<template-type-parameter name="TypeParameter"><purpose><para>A template parameter </para></purpose></template-type-parameter>
|
||||
<template-nontype-parameter name="NonTypeParameter"><type>int</type><purpose><para>This is a non-type template parameter </para></purpose></template-nontype-parameter>
|
||||
</template><description><para>Testing a function template.
|
||||
</para></description></function></namespace><macro name="EXAMPLE" kind="functionlike"><macro-parameter name="m"/><purpose>Documentation for macro example. </purpose></macro></header></library-reference>
|
||||
|
@ -114,6 +114,14 @@ namespace example
|
||||
* \see example::example and example_template
|
||||
*/
|
||||
int namespace_func(int i, int j);
|
||||
|
||||
/**
|
||||
* Testing a function template.
|
||||
* \tparam TypeParameter A template parameter
|
||||
* \tparam NonTypeParameter This is a non-type template parameter
|
||||
*/
|
||||
template <typename TypeParameter, int NonTypeParameter>
|
||||
void namespace_func_template();
|
||||
}
|
||||
|
||||
#define EXAMPLE(m) The macro
|
||||
|
@ -803,6 +803,8 @@
|
||||
<xsl:apply-templates select="description/*"/>
|
||||
|
||||
<xsl:if test="parameter/description|signature/parameter/description|
|
||||
template/template-type-parameter/purpose|
|
||||
template/template-nontype-parameter/purpose|
|
||||
requires|effects|postconditions|returns|throws|complexity|
|
||||
notes|rationale">
|
||||
<variablelist spacing="compact">
|
||||
@ -839,6 +841,37 @@
|
||||
</varlistentry>
|
||||
</xsl:if>
|
||||
|
||||
<!-- Document template parameters -->
|
||||
<xsl:if test="template/template-type-parameter/purpose|
|
||||
template/template-nontype-parameter/purpose">
|
||||
<varlistentry>
|
||||
<term>Template Parameters:</term>
|
||||
<listitem>
|
||||
<variablelist spacing="compact">
|
||||
<xsl:processing-instruction name="dbhtml">
|
||||
list-presentation="table"
|
||||
</xsl:processing-instruction>
|
||||
<xsl:for-each select="template/template-type-parameter|
|
||||
template/template-nontype-parameter">
|
||||
<xsl:sort select="attribute::name"/>
|
||||
<xsl:if test="purpose">
|
||||
<varlistentry>
|
||||
<term>
|
||||
<xsl:call-template name="monospaced">
|
||||
<xsl:with-param name="text" select="@name"/>
|
||||
</xsl:call-template>
|
||||
</term>
|
||||
<listitem>
|
||||
<xsl:apply-templates select="purpose/*"/>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</variablelist>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</xsl:if>
|
||||
|
||||
<!-- Document rest of function's contract -->
|
||||
<xsl:for-each select="requires|effects|postconditions|returns|throws|complexity|
|
||||
notes|rationale">
|
||||
|
@ -8,6 +8,9 @@
|
||||
-->
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
version="1.0">
|
||||
|
||||
<xsl:param name="template.param.brief" select="false()"/>
|
||||
|
||||
<!-- Determine the length of a template header synopsis -->
|
||||
<xsl:template name="template.synopsis.length">
|
||||
<xsl:variable name="text">
|
||||
@ -235,7 +238,7 @@
|
||||
<xsl:param name="parameters" select="template-type-parameter|template-varargs|template-nontype-parameter"/>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="$parameters/purpose">
|
||||
<xsl:when test="$parameters/purpose and $template.param.brief">
|
||||
<xsl:call-template name="template.reference.parameters.comments">
|
||||
<xsl:with-param name="indentation" select="$indentation"/>
|
||||
<xsl:with-param name="highlight" select="$highlight"/>
|
||||
|
32
xsl/type.xsl
32
xsl/type.xsl
@ -1191,6 +1191,38 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select="description"/>
|
||||
|
||||
<!-- Document template parameters -->
|
||||
<xsl:if test="(template/template-type-parameter/purpose|
|
||||
template/template-nontype-parameter/purpose)
|
||||
and not($template.param.brief)">
|
||||
<varlistentry>
|
||||
<term>Template Parameters:</term>
|
||||
<listitem>
|
||||
<variablelist spacing="compact">
|
||||
<xsl:processing-instruction name="dbhtml">
|
||||
list-presentation="table"
|
||||
</xsl:processing-instruction>
|
||||
<xsl:for-each select="template/template-type-parameter|
|
||||
template/template-nontype-parameter">
|
||||
<xsl:sort select="attribute::name"/>
|
||||
<xsl:if test="purpose">
|
||||
<varlistentry>
|
||||
<term>
|
||||
<xsl:call-template name="monospaced">
|
||||
<xsl:with-param name="text" select="@name"/>
|
||||
</xsl:call-template>
|
||||
</term>
|
||||
<listitem>
|
||||
<xsl:apply-templates select="purpose/*"/>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</variablelist>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:call-template name="class-members-reference"/>
|
||||
<xsl:apply-templates select="access" mode="namespace-reference"/>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user