Link to external mainpage

我与影子孤独终老i 提交于 2020-01-05 13:18:53

问题


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)

回答1:


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!



来源:https://stackoverflow.com/questions/11700452/link-to-external-mainpage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!