如何在Doxygen文档中包含文件夹?

15

我希望在Doxygen文档中包含文件夹。

我尝试过使用\page和\include,但没有成功,有人知道怎么做吗?这是目录树:

+根目录
-+控制器
--- category.php
-+模型
--- categories.php
- mainpage.php

这个有用吗:http://comments.gmane.org/gmane.text.doxygen.general/8425? - Matt Ellen
我想知道这个文件夹包含什么。图片?需要记录的类?要包含的HTML文件? - cweiske
@cweiske 这个文件夹包含需要文档化的类。 - Diani Chandra Pertiwi
@Matt Ellen 感谢您提供的链接 :) - Diani Chandra Pertiwi
@Matt Ellen,我已经尝试了链接中的示例,但页面上出现的内容无法点击。在该文件夹中有一些必须记录的类文件。我已经编辑了我的问题并添加了文件夹和文件树。谢谢。 - Diani Chandra Pertiwi
2个回答

26

在对你的问题的评论中,\page 命令将添加到手动编写的文档中的页面。例如,如果源文件包含 \page 声明,它将将其内容添加到文档索引中。你可以在这里添加额外的帮助,例如:

/*! \page overviewpage Architecture Overview
 *
 * \section memorymanagement Memory Management
 *
 * Some writing you want to appear as a help page in the documentation here.
 */

\include命令将会把一个文件的内容作为源代码块包含在当前文件中。

我认为您实际上是想知道如何让Doxygen添加多个源代码目录。 只要递归设置为YES(这不是默认值),如果您已将根文件夹设置为Doxygen输入,则它应该适用于您的结构。

RECURSIVE              = YES

如果你还没这样做,你可以像这样添加不同的文件夹,路径相对于Doxyfile文件。

#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------

# The INPUT tag can be used to specify the files and/or directories that contain 
# documented source files. You may enter file names like "myfile.cpp" or 
# directories like "/usr/src/myproject". Separate the files or directories 
# with spaces.

INPUT                  = src test/src

0

@Martin Foot提供的解决方案在您的文件夹名称中存在空格时无效,因为doxygen会将其视为单独的文件路径。如果引用整个内容,则无法正常工作。 从这里汲取灵感... 为Doxygen排除目录 这是我的建议解决方案,其中引用每个文件夹并使用多行语法。

INPUT                  = "src" 
INPUT                  += "spaced folder/test/src"

参考资料:https://www.doxygen.nl/manual/config.html

the += operator can be used instead of = to append new values to the list.

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接