breathe
breathe copied to clipboard
Supress duplicate declaration warning
Hi! Great work on the library!!
I have a question. I want to have two sections in my docs, one which gives the details per function, and one which gives just an overview. E.g. I would like to have
.. doxygenfunction:: Foo::Bar
:project: Foo
.. doxygennamespace:: Foo
:project: Foo
:content-only:
:outline:
:members:
:protected-members:
:private-members:
:undoc-members:
:no-link:
But this gives me
WARNING: Duplicate C++ declaration, also defined at ....
Declaration is '.. cpp:function:: Foo::Bar'.
Is there any way to avoid such a warning
These Breathe directives declares the entities through the underlying Sphinx directives, and as the warning suggests, this should only be done once. For C and C++ I believe the no-link
option does nothing (we should looks at getting it removed/redocumented/something).
Instead, you can use the Sphinx directive cpp:alias
and c:alias
(https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#directive-cpp-alias, https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#directive-c-alias).
For now only the C version can recursively write a synopsis (the maxdepth
option), but I am working on the same/similar functionality for the C++ version (see https://github.com/sphinx-doc/sphinx/issues/8213).