链接到外部主页 [英] Link to external mainpage
问题描述
我制作了Doxygen文档,该文档本身使用标记文件机制引用了另一个文档。但是我现在想在其主页内链接到外部文档的主页。当然,我总是可以直接指定文件:
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 ...
项目彼此相对。但是尽管如此,我还是希望Doxygen自动执行此过程,因为它仍然需要知道外部文档的位置。
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)
或
[OtherDoc](#OtherProject::mainpage)
推荐答案
有这是一个技巧。假设您有项目A和B,那么在项目A的主页中,您可以像这样放置 @anchor
命令:
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
*/
然后您可以在项目b的文档中使用
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!
这篇关于链接到外部主页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!