在Doxygen主页中截断名称空间 [英] Truncating namespaces in a Doxygen mainpage
问题描述
我正在编写一个C#库,并希望从我的 mainpage.md
文件链接到某些类的页面.但是,让Doxygen从主页上的文本中删除链接的唯一方法是在以下位置编写类的完全限定名称(例如 com.mycompany.myproject.MyClass
)主页,这有点难以阅读,而且反复编写确实很痛苦.我希望能够在主页上编写 MyClass
并将其链接到 com.mycompany.myproject.MyClass
.
I am writing a C# library and would like to link to some classes' pages from my mainpage.md
file. However, the only way I can get Doxygen to make the links out of the text in the mainpage is by writing the fully-qualified names of the classes (eg. com.mycompany.myproject.MyClass
) in the mainpage, which is a little hard to read and a real pain to write repeatedly. I would like to be able to just write MyClass
in the mainpage and have it link to com.mycompany.myproject.MyClass
.
无论如何,我的项目中只有一个名称空间:有什么方法可以使主页假定所有名称都隐式包含在该名称空间中?最糟糕的是,有没有一种很好的方法可以在生成过程中从类名中截断名称空间?现在,我最好的解决方案是在运行Doxygen自行编辑 index.html
后,使用 sed
运行HTML文件.
There is only one namespace in my project anyway: is there any way I can make the mainpage assume all names are implicitly within this namespace? At worst, is there a nice way to truncate the namespace from the class names during generation? Right now my best solution is to run over my HTML files with sed
after running Doxygen to edit index.html
myself.
推荐答案
我终于在基本上,答案是将我的 mainpage.md
文件更改为 mainpage.dox
文件,并用 namespace
包围我的主页.声明,就像这样:
Essentially, the answer was to change my mainpage.md
file into a mainpage.dox
file, and surround my mainpage with a namespace
declaration, like so:
namespace com.mycompany.myproject {
/**
* {mainpage text here}
*/
}
这使主页位于命名空间内,并指示Doxygen在正确的命名空间中查找主页正文中提到的任何类名.
This makes the mainpage within the namespace, and instructed Doxygen to look in the right namespace for any class names mentioned in the mainpage body.
这篇关于在Doxygen主页中截断名称空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!