1

We use Doxygen for documenting our C++ code and we include the Doxygen results in our Sphinx HTML documentation using the Breathe plugin. We want to jump directly to functions within the HTML documentation using named anchors in a HTML link like this:

http://path/MyClassDocumentation.html#myFunction(params)

The idea is to automatically jump to functions using their signature which we can retrieve dynamically at run time. How can we create these named anchors in our C++ Doxygen comments? Breathe creates HTML elements which address the functions using their signature and a md5 sum. Example:

<span id="my_class_my_function_1a21be2544e55395e0218006fca87a2a82"></span>

This is not helpful, because we cannot jump to these ids at run time using the signature of the function. Therefore we want to add our own named anchors which should look like this:

MyClass::MyFunc(paramList)

I tried using "\anchor" in our comments, but it seems they are ignored. Is there a way to get named anchors which we can define within our C++ code comments? Or is there another way for achieving this?

EDIT: I think what we need is something to define custom html permalinks addressing the functions in our C++ code from within the Doxygen comments.

3
  • Does ref address your issue? Commented Oct 10, 2017 at 11:44
  • Nope. Because ref --> Creates a reference to a named section, subsection, page or anchor. And I need to create the anchor from within the C++ code/comment. Commented Oct 10, 2017 at 11:51
  • I found out that Doxygen includes the anchors in his generated xml and html files if we use @anchor in the Doxygen code comments. It seems that Sphinx ignores them when generating the html help files. Maybe the problem is Breathe related. Commented Oct 11, 2017 at 8:32

1 Answer 1

1

I have a similar problem, wanting to link to doxygen documentation for C from a docbook document.

The solution is to generate a tagfile from doxygen using the GENERATE_TAGFILE configuration parameter.

I then parse the tagfile using some custom scripts to extract the anchor value for each function.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.