texttext-filesdoxygendoxywizard

How to get plain text files in Doxygen documentation?


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.

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.

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...

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


Solution

  • 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.

    From the documentation:

    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.