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

add option to no-link all directives in apidoc #378

Open
vermeeren opened this issue May 21, 2018 · 4 comments
Open

add option to no-link all directives in apidoc #378

vermeeren opened this issue May 21, 2018 · 4 comments
Labels
suggestion Possible enhancement, open for debate upstream Issue in external software

Comments

@vermeeren
Copy link
Collaborator

This will probably allow apidoc builds and manual directives to be mixed in the resulting sphinx build without triggering duplicate declaration warnings.

@vermeeren vermeeren self-assigned this May 21, 2018
@vermeeren vermeeren added enhancement Improvements, additions (also cosmetics) code Source code labels May 21, 2018
@rowanG077
Copy link

rowanG077 commented May 22, 2018

This doesn't solve the warnings. no-link controls whether a permalink is added to the declaration it has nothing to do with the declaration itself. What would work is adding the no-index option to the underlying sphinx domain directive but this option is not exposed through breathe. Besides it's not clear from the sphinx documentation that this is actually the correct way to circumvent this duplicate declaration warning.

There is an open issue for this on sphinx GitHub but no-index is not mentioned so I think it's not a documented way to handle this. But until this is resolved in Sphinx itself no-index could be a solution

See: sphinx-doc/sphinx#4981

@vermeeren
Copy link
Collaborator Author

What lead me to this idea was mainly the doc on the no-link option:

This allows you to have your main reference listings somewhere with targets, but then to be able to sneak in repeat directives into other parts of the documentation to illustrate particular points without Sphinx getting confused what should be linked to by other references.

Indeed I haven't looked into things or tested them out yet, I made the issue yesterday so I wouldn't forget. Thanks for the link to upstream.

Also tagging @jakobandersen so he is up-to-date.

@vermeeren vermeeren added suggestion Possible enhancement, open for debate upstream Issue in external software and removed code Source code enhancement Improvements, additions (also cosmetics) labels May 22, 2018
@vermeeren vermeeren removed their assignment Aug 27, 2019
@chausner-audeering
Copy link

I am running into the same issue. I am already using :no-link: to avoid link target conflicts but it would also be nice to get rid of the "WARNING: Duplicate C++ declaration" warning. The :no-index: workaround that @rowanG077 mentioned does not seem to be applicable without modifying Breathe, right?

@jakobandersen
Copy link
Collaborator

See also #594 (comment): the :no-link: option may do something on the Breathe side (I forgot), but on the Sphinx side it has been broken for a long time, and has now been removed (for the C and C++ domains).
How to resolve the problem depends a lot on what you are trying to achieve in your documentation. Sometimes the alias directives may be a solution, e.g., if you would like a synopsis-like construct. Sometimes some extra namespacing does it, e.g., as in the Breathe docs where you would like to show the same example multiple times with slight variations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion Possible enhancement, open for debate upstream Issue in external software
Projects
None yet
Development

No branches or pull requests

4 participants