mirror of
https://github.com/boostorg/boostbook.git
synced 2025-05-11 13:23:59 +00:00
Merge some boostbook changes from trunk. Fixes #5480.
The default/delete support, plus fix/update tests. [SVN r84302]
This commit is contained in:
parent
d208dbcb26
commit
cfe6f00c51
@ -4,7 +4,7 @@
|
|||||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
# http://www.boost.org/LICENSE_1_0.txt)
|
# http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
project boost/test ;
|
project /boost/boostbook/test ;
|
||||||
import boostbook : boostbook ;
|
import boostbook : boostbook ;
|
||||||
|
|
||||||
boostbook alt : alt.xml :
|
boostbook alt : alt.xml :
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" standalone="yes"?>
|
<?xml version="1.0" standalone="yes"?>
|
||||||
<library-reference id="example_reference"><title>Example Reference</title><header name="boost/example.hpp"><namespace name="example"><class name="example"><purpose>Documentation for class example. </purpose><class name="inner_class"><data-member name="x"><type>int</type></data-member></class><enum name="class_enum"><enumvalue name="enumerator"/></enum><typedef name="documented_type1"><description><para>This type has documentation. </para></description><type>int</type></typedef><typedef name="documented_type2"><purpose>This type has documentation. </purpose><type>long</type></typedef><typedef name="documented_type3"><description><para>This type has documentation. </para></description><type>long double</type></typedef><typedef name="undocumented_type1"><type>short</type></typedef><typedef name="undocumented_type2"><type>double</type></typedef><data-member name="integer"><type>int</type></data-member><data-member name="mutable_integer" specifiers="mutable"><type>int</type></data-member><data-member name="const_integer"><type>const int</type></data-member><data-member name="static_integer" specifiers="static"><type>int</type></data-member><data-member name="static_const_integer" specifiers="static"><type>const int</type></data-member><method-group name="public member functions"><method name="conversion-operator" cv="" specifiers="explicit"><type>int</type></method></method-group></class><struct name="example_template"><template>
|
<library-reference id="example_reference"><title>Example Reference</title><header name="boost/example.hpp"><namespace name="example"><class name="example"><purpose>Documentation for class example. </purpose><class name="inner_class"><data-member name="x"><type>int</type></data-member></class><enum name="class_enum"><enumvalue name="enumerator"/></enum><typedef name="documented_type1"><description><para>This type has documentation. </para></description><type>int</type></typedef><typedef name="documented_type2"><purpose>This type has documentation. </purpose><type>long</type></typedef><typedef name="documented_type3"><description><para>This type has documentation. </para></description><type>long double</type></typedef><typedef name="undocumented_type1"><type>short</type></typedef><typedef name="undocumented_type2"><type>double</type></typedef><data-member name="integer"><type>int</type></data-member><data-member name="mutable_integer" specifiers="mutable"><type>int</type></data-member><data-member name="const_integer"><type>const int</type></data-member><data-member name="static_integer" specifiers="static"><type>int</type></data-member><data-member name="static_const_integer" specifiers="static"><type>const int</type></data-member><method-group name="public member functions"><method name="conversion-operator" cv="" specifiers="explicit"><type>int</type></method></method-group><constructor cv="= default"><parameter name=""><paramtype><classname>example</classname> const &</paramtype></parameter></constructor><copy-assignment cv="= delete"><parameter name=""><paramtype><classname>example</classname> const &</paramtype></parameter></copy-assignment></class><struct name="example_template"><template>
|
||||||
<template-type-parameter name="TypeParameter"><purpose><para>A template parameter </para></purpose></template-type-parameter>
|
<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-nontype-parameter name="NonTypeParameter"><type>int</type><purpose><para>This is a non-type template parameter </para></purpose></template-nontype-parameter>
|
||||||
<template-type-parameter name="TypeParameterWithDefault"><default>int</default><purpose><para>This is a template parameter with a default argument </para></purpose></template-type-parameter>
|
<template-type-parameter name="TypeParameterWithDefault"><default>int</default><purpose><para>This is a template parameter with a default argument </para></purpose></template-type-parameter>
|
||||||
@ -21,7 +21,7 @@ Line 1<sbr/>
|
|||||||
<template-type-parameter name="T"/>
|
<template-type-parameter name="T"/>
|
||||||
</template></struct><struct-specialization name="specialization_test"><template>
|
</template></struct><struct-specialization name="specialization_test"><template>
|
||||||
<template-type-parameter name="T"/>
|
<template-type-parameter name="T"/>
|
||||||
</template><specialization><template-arg>T *</template-arg></specialization><method-group name="public member functions"/><constructor><description><para>A constructor. </para></description></constructor><destructor><description><para>A destructor. </para></description></destructor><copy-assignment><parameter name=""><paramtype>const <classname>specialization_test</classname> &</paramtype></parameter><description><para>An assignment operator. </para></description></copy-assignment></struct-specialization><enum name="namespace_enum"><enumvalue name="enumerator"/></enum><data-member name="namespace_integer"><type>int</type></data-member><data-member name="namespace_static_integer" specifiers="static"><type>int</type></data-member><data-member name="namespace_const_integer"><type>const int</type></data-member><data-member name="namespace_static_const_integer" specifiers="static"><type>const int</type></data-member><function name="namespace_func"><type>int</type><parameter name="i"><paramtype>int</paramtype><description><para>A function parameter </para></description></parameter><parameter name="j"><paramtype>int</paramtype><description><para>Another </para></description></parameter><description><para>
|
</template><specialization><template-arg>T *</template-arg></specialization><method-group name="public member functions"/><constructor><description><para>A constructor. </para></description></constructor><destructor><description><para>A destructor. </para></description></destructor><copy-assignment cv=""><parameter name=""><paramtype>const <classname>specialization_test</classname> &</paramtype></parameter><description><para>An assignment operator. </para></description></copy-assignment></struct-specialization><enum name="namespace_enum"><enumvalue name="enumerator"/></enum><data-member name="namespace_integer"><type>int</type></data-member><data-member name="namespace_static_integer" specifiers="static"><type>int</type></data-member><data-member name="namespace_const_integer"><type>const int</type></data-member><data-member name="namespace_static_const_integer" specifiers="static"><type>const int</type></data-member><function name="namespace_func"><type>int</type><parameter name="i"><paramtype>int</paramtype><description><para>A function parameter </para></description></parameter><parameter name="j"><paramtype>int</paramtype><description><para>Another </para></description></parameter><description><para>
|
||||||
|
|
||||||
|
|
||||||
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>
|
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>
|
||||||
|
@ -32,6 +32,9 @@ namespace example
|
|||||||
class example
|
class example
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
example(example const&) = default;
|
||||||
|
example& operator=(example const&) = delete;
|
||||||
|
|
||||||
int integer;
|
int integer;
|
||||||
static int static_integer;
|
static int static_integer;
|
||||||
mutable int mutable_integer;
|
mutable int mutable_integer;
|
||||||
|
@ -12,6 +12,7 @@ Usage: python build_docs.py [--generate-gold]
|
|||||||
import difflib, getopt, os, re, sys
|
import difflib, getopt, os, re, sys
|
||||||
import lxml.ElementInclude
|
import lxml.ElementInclude
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
from collections import defaultdict
|
||||||
|
|
||||||
# Globals
|
# Globals
|
||||||
|
|
||||||
@ -82,7 +83,7 @@ def run_boostbook(parser, boostbook_xsl, file):
|
|||||||
|
|
||||||
def normalize_boostbook_ids(doc):
|
def normalize_boostbook_ids(doc):
|
||||||
ids = {}
|
ids = {}
|
||||||
id_bases = {}
|
id_bases = defaultdict(int)
|
||||||
|
|
||||||
for node in doc.xpath("//*[starts-with(@id, 'id') or contains(@id, '_id')]"):
|
for node in doc.xpath("//*[starts-with(@id, 'id') or contains(@id, '_id')]"):
|
||||||
id = node.get('id')
|
id = node.get('id')
|
||||||
@ -90,13 +91,14 @@ def normalize_boostbook_ids(doc):
|
|||||||
if(id in ids):
|
if(id in ids):
|
||||||
print 'Duplicate id: ' + id
|
print 'Duplicate id: ' + id
|
||||||
|
|
||||||
match = re.match("(id|.+_id)([mp]?\d+)((?:-bb)?)", id)
|
match = re.match("(.+_id|id)([mp]?\d+)((?:-bb)?)", id)
|
||||||
if(match):
|
if(match):
|
||||||
count = 1
|
# Truncate id name, as it sometimes has different lengths...
|
||||||
if(match.group(1) in id_bases):
|
match2 = re.match("(.*?)([^.]*?)(_?id)", match.group(1))
|
||||||
count = id_bases[match.group(1)] + 1
|
base = match2.group(1) + match2.group(2)[:14] + match2.group(3)
|
||||||
id_bases[match.group(1)] = count
|
count = id_bases[base] + 1
|
||||||
ids[id] = match.group(1) + str(count) + match.group(3)
|
id_bases[base] = count
|
||||||
|
ids[id] = base + str(count) + match.group(3)
|
||||||
|
|
||||||
for node in doc.xpath("//*[@linkend or @id]"):
|
for node in doc.xpath("//*[@linkend or @id]"):
|
||||||
x = node.get('linkend')
|
x = node.get('linkend')
|
||||||
|
@ -51,6 +51,19 @@
|
|||||||
<xsl:key name="compounds-by-id" match="compounddef" use="@id"/>
|
<xsl:key name="compounds-by-id" match="compounddef" use="@id"/>
|
||||||
<xsl:key name="members-by-id" match="memberdef" use="@id" />
|
<xsl:key name="members-by-id" match="memberdef" use="@id" />
|
||||||
|
|
||||||
|
<!-- Add trailing slash to formuladir if missing -->
|
||||||
|
|
||||||
|
<xsl:variable name="boost.doxygen.formuladir.fixed">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="substring(boost.doxygen.formuladir, string-length(boost.doxygen.formuladir) - 1) = '/'">
|
||||||
|
<xsl:value-of select="$boost.doxygen.formuladir" />
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:value-of select="concat($boost.doxygen.formuladir, '/')" />
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:variable>
|
||||||
|
|
||||||
<xsl:strip-space elements="briefdescription detaileddescription inbodydescription"/>
|
<xsl:strip-space elements="briefdescription detaileddescription inbodydescription"/>
|
||||||
|
|
||||||
<xsl:template name="kind-error-message">
|
<xsl:template name="kind-error-message">
|
||||||
@ -1657,7 +1670,7 @@
|
|||||||
<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(concat($boost.doxygen.formuladir, 'form_'), @id), '.png')"/>
|
<xsl:value-of select="concat(concat(concat($boost.doxygen.formuladir.fixed, 'form_'), @id), '.png')"/>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
</imagedata>
|
</imagedata>
|
||||||
</imageobject>
|
</imageobject>
|
||||||
@ -1678,7 +1691,7 @@
|
|||||||
<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(concat($boost.doxygen.formuladir, 'form_'), @id), '.png')"/>
|
<xsl:value-of select="concat(concat(concat($boost.doxygen.formuladir.fixed, 'form_'), @id), '.png')"/>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
</imagedata>
|
</imagedata>
|
||||||
</imageobject>
|
</imageobject>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user