如何在 Doxygen 文档中获取纯文本文件?

How to get plain text files in Doxygen documentation?

我不能在我的 Doxygen 文档中包含任何文本文件。唯一的例外是我设置为主页的 README.md 文件。

特别是,我希望在文档中看到 Changelog.txt 文件。我试图在 INPUT 字段和 FILE_PATTERNS 字段中明确添加它,但没有成功。在生成的 HTML 文档中,无论是在文件列表中还是进行搜索,我都找不到任何内容。

唯一的痕迹在 Doxygen 的日志文件中:

Preprocessing C:/Source/Changelog.txt...
Parsing file C:/Source/Changelog.txt...
...
Parsing code for file Changelog.txt...

如果我将文件的扩展名从 txt 更改为 md,该文件将添加到文档中。

您需要 EXTENSION_MAPPING=txt=md,否则 .txt 文件将作为 C / C++ 源文件处理,并且缺少注释符号,导致没有输出。

来自文档:

EXTENSION_MAPPING Doxygen selects the parser to use depending on the extension of the files it parses. With this tag you can assign which parser to use for a given extension. Doxygen has a built-in mapping, but you can override or extend it using this tag. The format is ext=language, where ext is a file extension, and language is one of the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: Fortran. In the later case the parser tries to guess whether the code is fixed or free formatted code, this is the default for Fortran type files), VHDL. For instance to make doxygen treat .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note: For files without extension you can use no_extension as a placeholder. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.