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

问题描述:

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

I cannot include any text file in my Doxygen documentation. The only exception is a README.md file that I set as the main page.

特别是,我会希望查看文档中的 Changelog.txt 文件。我试图将其显式添加到 INPUT 字段和 FILE_PATTERNS 字段中,但没有成功。在生成的HTML文档中,我无法在文件列表中找到任何内容,也无法进行搜索。

In particular, I would like to see the Changelog.txt file in the documentation. I tried to add it explicitly in the INPUT field and in the FILE_PATTERNS field, without success. In the generated HTML documentation, I cannot find anything neither in the file list nor making a search.

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

The only trace is in Doxygen's log file:

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






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


If I change the extension of the file from txt to md, the file is added to the documentation.

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

You need EXTENSION_MAPPING=txt=md otherwise the .txt file is handled as a C / C++ source file and it is missing comment signs, resulting in no output.

从文档中:


EXTENSION_MAPPING Doxygen选择要使用的解析器取决于它解析的文件的
扩展名。使用此标记,您可以分配给定扩展名使用哪个
解析器。 Doxygen具有内置映射
,但是您可以使用此标记覆盖或扩展它。格式为
ext = language,其中ext是文件扩展名,语言是doxygen支持的
解析器之一:IDL,Java,Javascript,C#,C,C ++,
D ,PHP,Objective-C,Python,Fortran(固定格式Fortran:
Fortran固定,自由格式的Fortran:FortranFree,未知格式的
Fortran:Fortran。在后一种情况下,解析器尝试猜测
该代码是固定或自由格式的代码,这是
Fortran类型文件的默认值),VHDL。例如,要使doxygen将.inc
文件视为Fortran文件(默认为PHP),而将.f文件视为C(默认为
Fortran),请使用:inc = Fortran f = C。注意:对于没有扩展名的文件,您
可以使用no_extension作为占位符。请注意,对于自定义扩展名
,还需要设置FILE_PATTERNS,否则
doxygen不会读取文件。

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.