2013-04-25 59 views
2

Doxygen允许您生成手册页输出,但据我所知它只能为实际代码(函数,类等)生成手册页。我在doxygen @mainpage注释中提供了大量信息,例如示例,这些信息不会显示在手册页输出中的任何位置。我想用这种格式来制作它,以便我也有一个可以作为整体介绍的手册页。有doxygen这样做的方法吗?如何获取主页的手册页输出?

到目前为止,我还没有找到一种方法,我已经探索过的替代方法对于doxygen为我创建的index.html文件不起作用。例如,我在index.html文件上尝试了几个不同的html2man脚本,但没有成功。

回答

0

您是否在包含@main doumentation的文件中包含@file <filename>评论,而<filename>确实与实际文件名匹配?

的Doxygen将不包括来自文件的文档不具有至少this.`

http://www.stack.nl/~dimitri/doxygen/manual/commands.html#cmdfile

+0

感谢您的建议。我刚刚尝试添加一个@file注释,其中包含扩展名为.dox的附加文件的全名,但是其中没有任何信息出现在man输出中。 – Troy 2013-05-01 16:11:16

0

据我所知,这是不可能的。 HTML输出涵盖整个项目,而手册页输出涵盖单个@file。 @mainpage适用于整个项目,而不是任何特定的@file。因此,doxygen不会为man输出输出@mainpage。

我下载了源码,并浏览了src/layout.cpp。搜索(例如)BriefDesc,你会看到每个“布局处理程序”如何放在一起。我还不知道@mainpage映射到什么地方,但显然它不是在“文件布局处理程序”部分中添加的内容。

我尝试添加@mainpage或@page,并使用@ref来引用它,看我是否可以创建2个手册页并手动将它们绑定在一起,但仍然有一个很好的HTML首页。例如,我试图获得2个手册页,foo和foo-intro。要做到这一点,我需要@page。但对于HTML输出,介绍显示在“相关页面”下,而不是“主页面”。然而@mainpage似乎无法触发单独的手册页。不理想。

1

我想出了这个变通办法,这使伪炫魅文本手册页,并从HTML炫魅提出一个很好的链接到它:

/** 
* @mainpage 
* Summary of my simple project. Please see @ref foo.h for more details. 
* 
* @file foo.h 
* @brief Summary of my simple project. 
* 
* Here is the much more detailed description of my project, 
* originally intended for the main page. Since I value the quality 
* of man page output the most, this will end up on the individual 
* file man page, and will be linked to from the HTML main page. 
* I can rattle on with other things like... 
* @todo find a better solution to the mainpage problem. 
*/