with :gh:`doxygen/doxygen#6729` integrated, the 1.8.15 release does not
have this option yet.
+`Inline namespaces`_
+--------------------
+
+:cpp:`inline namespace`\ s are marked as such in class/namespace index pages,
+namespace documentation pages and nested namespace lists. Doxygen additionally
+flattens those, so their contents appear in the parent namespace as well.
+
+.. note-warning:: Doxygen patches
+
+ This feature requires :gh:`doxygen/doxygen#7828` to work (not merged to
+ Doxygen master yet).
+
`Include files`_
----------------
:py:`compound.footer_navigation` Footer navigation of a page. See
`Navigation properties`_ for details.
:py:`compound.brief` Brief description. Can be empty. [1]_
+:py:`compound.is_inline` Whether the namespace is :cpp:`inline`.
+ Set only for namespaces.
:py:`compound.is_final` Whether the class is :cpp:`final`. Set
only for classes.
:py:`compound.deprecated` Deprecation status [7]_
:py:`namespace.deprecated` Deprecation status [7]_
:py:`namespace.since` Since which version the namespace is available
[8]_
+:py:`namespace.is_inline` Whether this is an :cpp:`inline` namespace
=============================== ===============================================
`Class properties`_
:py:`i.brief` Brief documentation
:py:`i.deprecated` Deprecation status [7]_
:py:`i.since` Since which version the entry is available [8]_
+:py:`i.is_inline` Whether this is an :cpp:`inline` namespace. Set
+ only for namespaces.
:py:`i.is_final` Whether the class is :cpp:`final`. Set only for
classes.
:py:`i.has_nestable_children` If the list has nestable children (i.e., dirs
compound.deprecated = 'deprecated'
break
+ # Inline namespaces
+ if compound.kind == 'namespace':
+ compound.is_inline = compounddef.attrib.get('inline') == 'yes'
+
# Final classes
if compound.kind in ['struct', 'class', 'union']:
compound.is_final = compounddef.attrib.get('final') == 'yes'
else:
state.current_prefix = []
+ # Inline namespaces
+ if compound.kind == 'namespace':
+ compound.is_inline = compounddef.attrib.get('inline') == 'yes'
+
# Final classes
if compound.kind in ['struct', 'class', 'union']:
compound.is_final = compounddef.attrib.get('final') == 'yes'
namespace.brief = symbol.brief
namespace.deprecated = symbol.deprecated
namespace.since = symbol.since
+ namespace.is_inline = compounddef_child.attrib.get('inline') == 'yes'
compound.namespaces += [namespace]
else:
entry.deprecated = compound.deprecated
entry.since = compound.since
entry.has_nestable_children = False
+ if compound.kind == 'namespace':
+ entry.is_inline = compound.is_inline
if compound.kind in ['class', 'struct', 'union']:
entry.is_final = compound.is_final
{% for i in index.symbols recursive %}
{% if i.children %}
<li class="m-doc-collapsible{% if loop.depth > CLASS_INDEX_EXPAND_LEVELS or (i.kind != 'namespace' and not CLASS_INDEX_EXPAND_INNER) %} collapsed{% endif %}">
- <a href="#" onclick="return toggle(this)">{{ i.kind }}</a> <a href="{{ i.url }}" class="m-doc">{{ i.name }}</a>{% if i.is_final %} <span class="m-label m-flat m-warning">final</span>{% endif %}{% if i.deprecated %} <span class="m-label m-danger">{{ i.deprecated }}</span>{% endif %}{% if i.since %} {{ i.since }}{% endif %} <span class="m-doc">{{ i.brief }}</span>
+ <a href="#" onclick="return toggle(this)">{{ i.kind }}</a> <a href="{{ i.url }}" class="m-doc">{{ i.name }}</a>{% if i.is_inline %} <span class="m-label m-flat m-info">inline</span>{% endif %}{% if i.is_final %} <span class="m-label m-flat m-warning">final</span>{% endif %}{% if i.deprecated %} <span class="m-label m-danger">{{ i.deprecated }}</span>{% endif %}{% if i.since %} {{ i.since }}{% endif %} <span class="m-doc">{{ i.brief }}</span>
<ul class="m-doc">
{{ loop(i.children)|rtrim|indent(4, true) }}
</ul>
</li>
{% else %}
- <li>{{ i.kind }} <a href="{{ i.url }}" class="m-doc">{{ i.name }}</a>{% if i.is_final %} <span class="m-label m-flat m-warning">final</span>{% endif %}{% if i.deprecated %} <span class="m-label m-danger">{{ i.deprecated }}</span>{% endif %}{% if i.since %} {{ i.since }}{% endif %} <span class="m-doc">{{ i.brief }}</span></li>
+ <li>{{ i.kind }} <a href="{{ i.url }}" class="m-doc">{{ i.name }}</a>{% if i.is_inline %} <span class="m-label m-flat m-info">inline</span>{% endif %}{% if i.is_final %} <span class="m-label m-flat m-warning">final</span>{% endif %}{% if i.deprecated %} <span class="m-label m-danger">{{ i.deprecated }}</span>{% endif %}{% if i.since %} {{ i.since }}{% endif %} <span class="m-doc">{{ i.brief }}</span></li>
{% endif %}
{% endfor %}
</ul>
- <dt>namespace <a href="{{ namespace.url }}" class="m-doc">{{ namespace.name }}</a>{% if namespace.deprecated %} <span class="m-label m-danger">{{ namespace.deprecated }}</span>{% endif %}{% if namespace.since %} {{ namespace.since }}{% endif %}</dt>
+ <dt>namespace <a href="{{ namespace.url }}" class="m-doc">{{ namespace.name }}</a>{% if namespace.is_inline %} <span class="m-label m-flat m-info">inline</span>{% endif %}{% if namespace.deprecated %} <span class="m-label m-danger">{{ namespace.deprecated }}</span>{% endif %}{% if namespace.since %} {{ namespace.since }}{% endif %}</dt>
<dd>{{ namespace.brief }}</dd>
{% block header %}
<h1>
- {%+ for name, target in compound.breadcrumb[:-1] %}<span class="m-breadcrumb"><a href="{{ target }}">{{ name }}</a>::<wbr/></span>{% endfor %}{{ compound.breadcrumb[-1][0] }} <span class="m-thin">namespace</span>{% if compound.since %} {{ compound.since }}{% endif %}
+ {%+ for name, target in compound.breadcrumb[:-1] %}<span class="m-breadcrumb"><a href="{{ target }}">{{ name }}</a>::<wbr/></span>{% endfor %}{{ compound.breadcrumb[-1][0] }} <span class="m-thin">namespace</span>{% if compound.is_inline %} <span class="m-label m-flat m-info">inline</span>{% endif %}{% if compound.since %} {{ compound.since }}{% endif %}
{# need an explicit space here otherwise the newline gets removed #}
{% if compound.include %}
{% for i in index.symbols|selectattr('kind', 'equalto', 'namespace') recursive %}
{% if i.has_nestable_children %}
<li class="m-doc-collapsible">
- <a href="#" onclick="return toggle(this)">{{ i.kind }}</a> <a href="{{ i.url }}" class="m-doc">{{ i.name }}</a>{% if i.deprecated %} <span class="m-label m-danger">{{ i.deprecated }}</span>{% endif %}{% if i.since %} {{ i.since }}{% endif %} <span class="m-doc">{{ i.brief }}</span>
+ <a href="#" onclick="return toggle(this)">{{ i.kind }}</a> <a href="{{ i.url }}" class="m-doc">{{ i.name }}</a>{% if i.is_inline %} <span class="m-label m-flat m-info">inline</span>{% endif %}{% if i.deprecated %} <span class="m-label m-danger">{{ i.deprecated }}</span>{% endif %}{% if i.since %} {{ i.since }}{% endif %} <span class="m-doc">{{ i.brief }}</span>
<ul class="m-doc">
{{ loop(i.children|selectattr('kind', 'equalto', 'namespace'))|rtrim|indent(4, true) }}
</ul>
</li>
{% else %}
- <li>{{ i.kind }} <a href="{{ i.url }}" class="m-doc">{{ i.name }}</a>{% if i.deprecated %} <span class="m-label m-danger">{{ i.deprecated }}</span>{% endif %}{% if i.since %} {{ i.since }}{% endif %} <span class="m-doc">{{ i.brief }}</span></li>
+ <li>{{ i.kind }} <a href="{{ i.url }}" class="m-doc">{{ i.name }}</a>{% if i.is_inline %} <span class="m-label m-flat m-info">inline</span>{% endif %}{% if i.deprecated %} <span class="m-label m-danger">{{ i.deprecated }}</span>{% endif %}{% if i.since %} {{ i.since }}{% endif %} <span class="m-doc">{{ i.brief }}</span></li>
{% endif %}
{% endfor %}
</ul>
--- /dev/null
+INPUT = File.h
+QUIET = YES
+GENERATE_HTML = NO
+GENERATE_LATEX = NO
+GENERATE_XML = YES
+XML_PROGRAMLISTING = NO
+CASE_SENSE_NAMES = YES
+
+##! M_PAGE_FINE_PRINT =
+##! M_THEME_COLOR =
+##! M_FAVICON =
+##! M_LINKS_NAVBAR1 =
+##! M_LINKS_NAVBAR2 =
+##! M_SEARCH_DISABLED = YES
+##! M_CLASS_TREE_EXPAND_LEVELS = 3
--- /dev/null
+/** @brief A namespace */
+namespace Foo {
+
+/** @brief An inline nested namespace */
+inline namespace Bar {
+
+/** @brief Another inline namespace */
+inline namespace Baz {}
+
+}
+
+/** @brief A thing */
+struct Thing {};
+
+}
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>My Project</title>
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
+ <link rel="stylesheet" href="m-dark+documentation.compiled.css" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+ <div class="m-container">
+ <div class="m-row">
+ <a href="index.html" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">My Project</a>
+ </div>
+ </div>
+</nav></header>
+<main><article>
+ <div class="m-container m-container-inflatable">
+ <div class="m-row">
+ <div class="m-col-l-10 m-push-l-1">
+ <h1>Classes</h2>
+ <ul class="m-doc">
+ <li class="m-doc-collapsible">
+ <a href="#" onclick="return toggle(this)">namespace</a> <a href="namespaceFoo.html" class="m-doc">Foo</a> <span class="m-doc">A namespace.</span>
+ <ul class="m-doc">
+ <li class="m-doc-collapsible">
+ <a href="#" onclick="return toggle(this)">namespace</a> <a href="namespaceFoo_1_1Bar.html" class="m-doc">Bar</a> <span class="m-label m-flat m-info">inline</span> <span class="m-doc">An inline nested namespace.</span>
+ <ul class="m-doc">
+ <li>namespace <a href="namespaceFoo_1_1Bar_1_1Baz.html" class="m-doc">Baz</a> <span class="m-label m-flat m-info">inline</span> <span class="m-doc">Another inline namespace.</span></li>
+ </ul>
+ </li>
+ <li>struct <a href="structFoo_1_1Thing.html" class="m-doc">Thing</a> <span class="m-doc">A thing.</span></li>
+ </ul>
+ </li>
+ </ul>
+ <script>
+ function toggle(e) {
+ e.parentElement.className = e.parentElement.className == 'm-doc-collapsible' ?
+ 'm-doc-expansible' : 'm-doc-collapsible';
+ return false;
+ }
+ /* Collapse all nodes marked as such. Doing it via JS instead of
+ directly in markup so disabling it doesn't harm usability. The list
+ is somehow regenerated on every iteration and shrinks as I change
+ the classes. It's not documented anywhere and I'm not sure if this
+ is the same across browsers, so I am going backwards in that list to
+ be sure. */
+ var collapsed = document.getElementsByClassName("collapsed");
+ for(var i = collapsed.length - 1; i >= 0; --i)
+ collapsed[i].className = 'm-doc-expansible';
+ </script>
+ </div>
+ </div>
+ </div>
+</article></main>
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Foo::Bar namespace | My Project</title>
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
+ <link rel="stylesheet" href="m-dark+documentation.compiled.css" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+ <div class="m-container">
+ <div class="m-row">
+ <a href="index.html" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">My Project</a>
+ </div>
+ </div>
+</nav></header>
+<main><article>
+ <div class="m-container m-container-inflatable">
+ <div class="m-row">
+ <div class="m-col-l-10 m-push-l-1">
+ <h1>
+ <span class="m-breadcrumb"><a href="namespaceFoo.html">Foo</a>::<wbr/></span>Bar <span class="m-thin">namespace</span> <span class="m-label m-flat m-info">inline</span>
+ </h1>
+ <p>An inline nested namespace.</p>
+ <div class="m-block m-default">
+ <h3>Contents</h3>
+ <ul>
+ <li>
+ Reference
+ <ul>
+ <li><a href="#namespaces">Namespaces</a></li>
+ </ul>
+ </li>
+ </ul>
+ </div>
+ <section id="namespaces">
+ <h2><a href="#namespaces">Namespaces</a></h2>
+ <dl class="m-doc">
+ <dt>namespace <a href="namespaceFoo_1_1Bar_1_1Baz.html" class="m-doc">Baz</a> <span class="m-label m-flat m-info">inline</span></dt>
+ <dd>Another inline namespace.</dd>
+ </dl>
+ </section>
+ </div>
+ </div>
+ </div>
+</article></main>
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>My Project</title>
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
+ <link rel="stylesheet" href="m-dark+documentation.compiled.css" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+ <div class="m-container">
+ <div class="m-row">
+ <a href="index.html" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">My Project</a>
+ </div>
+ </div>
+</nav></header>
+<main><article>
+ <div class="m-container m-container-inflatable">
+ <div class="m-row">
+ <div class="m-col-l-10 m-push-l-1">
+ <h1>Namespaces</h2>
+ <ul class="m-doc">
+ <li class="m-doc-collapsible">
+ <a href="#" onclick="return toggle(this)">namespace</a> <a href="namespaceFoo.html" class="m-doc">Foo</a> <span class="m-doc">A namespace.</span>
+ <ul class="m-doc">
+ <li class="m-doc-collapsible">
+ <a href="#" onclick="return toggle(this)">namespace</a> <a href="namespaceFoo_1_1Bar.html" class="m-doc">Bar</a> <span class="m-label m-flat m-info">inline</span> <span class="m-doc">An inline nested namespace.</span>
+ <ul class="m-doc">
+ <li>namespace <a href="namespaceFoo_1_1Bar_1_1Baz.html" class="m-doc">Baz</a> <span class="m-label m-flat m-info">inline</span> <span class="m-doc">Another inline namespace.</span></li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ <script>
+ function toggle(e) {
+ e.parentElement.className = e.parentElement.className == 'm-doc-collapsible' ?
+ 'm-doc-expansible' : 'm-doc-collapsible';
+ return false;
+ }
+ /* Collapse all nodes marked as such. Doing it via JS instead of
+ directly in markup so disabling it doesn't harm usability. The list
+ is somehow regenerated on every iteration and shrinks as I change
+ the classes. It's not documented anywhere and I'm not sure if this
+ is the same across browsers, so I am going backwards in that list to
+ be sure. */
+ var collapsed = document.getElementsByClassName("collapsed");
+ for(var i = collapsed.length - 1; i >= 0; --i)
+ collapsed[i].className = 'm-doc-expansible';
+ </script>
+ </div>
+ </div>
+ </div>
+</article></main>
+</body>
+</html>
def test(self):
self.run_doxygen(wildcard='*.xml')
self.assertEqual(*self.actual_expected_contents('structNamespace_1_1MyClass.html'))
+
+class InlineNamespace(IntegrationTestCase):
+ def test(self):
+ self.run_doxygen(wildcard='*.xml')
+
+ with open(os.path.join(self.path, 'xml/namespaceFoo_1_1Bar.xml')) as f:
+ if 'kind="namespace" inline="yes"' not in f.read():
+ self.skipTest("Doxygen doesn't support inline namespaces here")
+
+ self.assertEqual(*self.actual_expected_contents('namespaceFoo_1_1Bar.html'))
+ self.assertEqual(*self.actual_expected_contents('annotated.html'))
+ self.assertEqual(*self.actual_expected_contents('namespaces.html'))