在 doxygen 文件列表中隐藏文件

Hide file in doxygen file list

我们有一个文件 'documentation.cs',我们不希望它显示在我们的 Doxygen 文件列表中。我应该向我们的配置或文件添加什么以将其从文件列表中隐藏?

EXCLUDE 的 Doxygen documentation 状态:

The EXCLUDE tag can be used to specify files and/or directories that should be excluded from the INPUT source files. This way you can easily exclude a subdirectory from a directory tree whose root is specified with the INPUT tag. Note that relative paths are relative to the directory from which doxygen is run.

所以你可以将这一行添加到你的 doxygen 配置文件中以删除 documentation.cs:

EXCLUDE_PATTERNS = documentation.cs
# EXCLUDE_PATTERNS = */documentation.cs

然后如果你想隐藏更多文件...

EXCLUDE_PATTERNS += another_file.cs

这也适用于整个目录。

EXCLUDE_PATTERNS += */directory/*

您也可以简单地将文件名更改为 .dox.doc.txt 扩展名。参考this answer:

There are 3 possible extensions which doxygen treats as additional documentation files: .dox, .txt, and .doc.
Files [with] such extension are hidden from the file index. Inside the file you need to put one or more C/C++ style comment blocks.

所以将 'documentation.cs' 重命名为 'documentation.dox',但保留里面的 C 风格注释。 (假设这就是您使用的 - 不确定您为什么决定添加 .cs 扩展名,它看起来不像是 C# 源文件)

确保将文件保留在当前目录中(如果 INPUT 留空)或将其添加到 INPUT 设置中包含的目录中。

编辑:根据 this 网页,您可能需要将 FILE_PATTERNS += *.dox 添加到您的 Doxyfile。我不知道现在是否自动支持文件扩展名,但在撰写博客时不支持。