2

I have made a Doxygen documentation, which itself references another documentation using the tag-file mechanism. But inside its mainpage I now would like to link to the mainpage of the external documentation. Of course, I can always specify the file directly:

... uses [OtherDoc](../../../OtherProject/doc/html/index.html) for ...

even more so since the projects are located relative to each other. But nevertheless I would like Doxygen to automate this process, since it needs to know the location of the external documentation, anyway.

So is there a way to somehow symbolically reference the external documentation's mainpage, something along the lines of:

[OtherDoc](\ref OtherProject::mainpage)

or

[OtherDoc](#OtherProject::mainpage)
2
  • If you close your open bounty I will add a higher one. Commented Jul 30, 2012 at 14:52
  • Very good question. We will probably have to wait till the end of the bounty period. Commented Jul 30, 2012 at 15:05

1 Answer 1

3
+50

There is a trick to do this. Say you have projects A and B, then in the main page of project A you could put an @anchor command like so:

/** @mainpage
 *  @anchor project_a
 */

And in the documentation of project b you can then simply use

 [OtherDoc](\ref project_a)

Note that anchors have to be globally unique, so you need to carefully choose them!

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

4 Comments

Since the answer comes directly from you, I can assume this is the best and most direct way to achieve this?
The problem is now only, that the link opens the page slightly scrolled down (making the mainpage's title disappear), because I have to place the anchor below the {#mainpage}-labeled heading, in order for the markdown file to be correctly recognized as mainpage. But I may be able to live with that, at least the goal is a step nearer now.
The best solution would be to have a way to explicitly tell doxygen where to look for a symbol, so you could use something like \ref a.tag:index to refer to project A's index page. That's currently not implemented though.
Has this still not been fixed?

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.