1
votes

I am trying to include a .ini file in the doxygen documentation of a C++ class, using \include. This works fine, but for some reason, doxygen treats the contents of the file as C code, which leads to strange formatting. I know \include surrounds the included file with a \code block, and that you can pass specific language information to the code block by using e.g. \code{.unparsed}. Is there a way to do the same with \include? \include{.unparsed} does not work...

1
Can you use \verbinclude? - albert
That would work for my purpose. But if there is a way to pass on parameters to the \code block, I would still be interested to know how. - B. Vandenbroucke
\include takes the file name and determines the language based on the extension (and settings in EXTENSION_MAPPING). The fallback for unknown extensions is C. In case of \code the language of the block is unknown and doesn't have to match language of the file (e.g. a Fortran or C code block in a markdown descriptive text block), therefore the {...} can be specified with \code. - albert

1 Answers

1
votes

Seems the answer to the question is "no": you cannot indicate a language when using \include, since doxygen tries to determine the language based on the extension. If it fails to do so, it reverts to C. If you do not want C formatting for unsupported file extensions, you can use \verbinclude instead of \include.