Skip to content

Commit

Permalink
Update docs to prevent most duplicate delcarations.
Browse files Browse the repository at this point in the history
Use .. cpp:namespace:: to put each example in its own namespace.
  • Loading branch information
jakobandersen committed Apr 6, 2020
1 parent 9a651b8 commit cc417ce
Show file tree
Hide file tree
Showing 27 changed files with 285 additions and 91 deletions.
2 changes: 1 addition & 1 deletion documentation/Makefile
Expand Up @@ -2,7 +2,7 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXOPTS = -vn
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR ?= build
Expand Down
1 change: 0 additions & 1 deletion documentation/source/autofile.rst
Expand Up @@ -22,4 +22,3 @@ It produces this output:

.. autodoxygenfile:: auto_class.h
:project: auto

This comment has been minimized.

Copy link
@juhuebner

juhuebner Jun 4, 2020

@jakobandersen
Line 13 should also be changed to :project: auto as well.
Possibly this holds also for the other examples.

:no-link:
3 changes: 2 additions & 1 deletion documentation/source/autoindex.rst
Expand Up @@ -20,7 +20,8 @@ With the following config value::

It produces this output:

.. cpp:namespace:: @ex_autoindex

.. autodoxygenindex::
:project: auto
:no-link:

30 changes: 20 additions & 10 deletions documentation/source/class.rst
Expand Up @@ -43,6 +43,8 @@ specified class.
Basic Example
-------------

.. cpp:namespace:: @ex_class_basic

This displays the class documentation without any members:

.. code-block:: rst
Expand All @@ -54,12 +56,13 @@ It produces this output:

.. doxygenclass:: Nutshell
:project: nutshell
:no-link:


Template Specialisation Example
-------------------------------

.. cpp:namespace:: @ex_class_template_spec

You can reference class template specialisations by include the specialisation
in the name:

Expand All @@ -72,7 +75,6 @@ Produces this output:

.. doxygenclass:: TemplateClass< T * >
:project: template_specialisation
:no-link:

Where as without the specialisation, the directive references the generic
declaration:
Expand All @@ -86,12 +88,13 @@ Produces this output:

.. doxygenclass:: TemplateClass
:project: template_specialisation
:no-link:


Members Example
---------------

.. cpp:namespace:: @ex_class_members

This directive call will display the class documentation with all the public
members:

Expand All @@ -106,12 +109,13 @@ It produces this output:
.. doxygenclass:: Nutshell
:project: nutshell
:members:
:no-link:


Specific Members Example
------------------------

.. cpp:namespace:: @ex_class_members_specific

This displays the class documentation with only the members listed in the
``:members:`` option:

Expand All @@ -126,12 +130,13 @@ It produces this output:
.. doxygenclass:: Nutshell
:project: nutshell
:members: crack, isCracked
:no-link:


Protected Members
-----------------

.. cpp:namespace:: @ex_class_members_protected

This displays only the protected members of the class. Normally this is combined
with the ``:members:`` option to show the public members as well.

Expand All @@ -146,12 +151,13 @@ It produces this output:
.. doxygenclass:: GroupedClassTest
:project: group
:protected-members:
:no-link:


Private Members
---------------

.. cpp:namespace:: @ex_class_members_private

This displays only the private members of the class. Normally this is combined
with the ``:members:`` option to show the public members as well.

Expand All @@ -166,11 +172,12 @@ It produces this output:
.. doxygenclass:: Nutshell
:project: nutshell
:private-members:
:no-link:

Undocumented Members
--------------------

.. cpp:namespace:: @ex_class_members_undocumented

This displays the undocumented members of the class which are suppressed by
default. Undocumented public members are only shown if the ``:members:`` option
is also used. The same goes for the undocumented private members and the
Expand All @@ -191,7 +198,6 @@ It produces this output:
:members:
:private-members:
:undoc-members:
:no-link:

.. note::

Expand All @@ -201,6 +207,8 @@ It produces this output:
Outline Example
---------------

.. cpp:namespace:: @ex_class_outline

This displays only the names of the class members and not their
documentation. The ``:members:`` and ``:private-members:`` options determine
which members are displayed.
Expand All @@ -218,12 +226,13 @@ It produces this output:
:project: nutshell
:members:
:outline:
:no-link:


Qt Signals & Slots Example
--------------------------

.. cpp:namespace:: @ex_class_qt

Doxygen is aware of Qt Signals and Slots and so Breathe can pick them up and
display them in the output. They are displayed in appropriate ``Signals``,
``Public Slots``, ``Protected Slots`` and ``Private Slots`` sections.
Expand All @@ -239,11 +248,12 @@ Produces the following output:
.. doxygenclass:: QtSignalSlotExample
:project: qtsignalsandslots
:members:
:no-link:

Failing Example
---------------

.. cpp:namespace:: @ex_class_failing

This intentionally fails:

.. code-block:: rst
Expand Down
10 changes: 10 additions & 0 deletions documentation/source/domains.rst
Expand Up @@ -15,6 +15,8 @@ The following targets are supported:
Class Example
-------------

.. cpp:namespace:: @ex_domains_class

Given the following Breathe directives::

.. doxygenclass:: testnamespace::NamespacedClassTest
Expand All @@ -38,6 +40,8 @@ which renders as: :cpp:class:`another reference <testnamespace::NamespacedClassT
Inner Class Example
-------------------

.. cpp:namespace:: @ex_domains_inner_class

Given the following Breathe directive::

.. doxygenclass:: OuterClass
Expand All @@ -59,6 +63,8 @@ which renders as :cpp:class:`OuterClass::InnerClass`.
Function Examples
-----------------

.. cpp:namespace:: @ex_domains_function

Given the following Breathe directives::

.. doxygenfunction:: testnamespace::NamespacedClassTest::function
Expand Down Expand Up @@ -99,6 +105,8 @@ which renders as: :c:func:`another reference <frob_foos()>`. Note the use of the
Typedef Examples
----------------

.. cpp:namespace:: @ex_domains_typedef

Given the following Breathe directives::

.. doxygentypedef:: TestTypedef
Expand Down Expand Up @@ -140,6 +148,8 @@ which renders as :cpp:type:`TestClass::MemberTypedef`.
Enum Value Examples
-------------------

.. cpp:namespace:: @ex_domains_enum

Given the following Breathe directives::

.. doxygenenumvalue:: VALUE
Expand Down

0 comments on commit cc417ce

Please sign in to comment.