Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supress duplicate declaration warning #634

Open
tdegeus opened this issue Feb 8, 2021 · 1 comment
Open

Supress duplicate declaration warning #634

tdegeus opened this issue Feb 8, 2021 · 1 comment

Comments

@tdegeus
Copy link

tdegeus commented Feb 8, 2021

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

@jakobandersen
Copy link
Collaborator

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 sphinx-doc/sphinx#8213).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants