-
Generally I want Doxygen to allow viewing the source code of documented files. But I want a part of the source code to be hidden.
I know how to force Doxygen not to document certain piece of code (e.g. with /cond /endcond), but it still appears when clicking on “Go to the source code of this file”.What I actually want is: if something is not commented in Doxygen-style, it shall appear nowhere at all, not in the documentation nor within “Go to the source code of this file”.
This shall be the case for functions as well as for #-defines or whatever. -
I use @hideinitializer to hide the initializer for #-defines. That works well within the documentation. But again, the initializer is still shown within the source code.
Does anybody have any suggestions?
You can pre-process source files by specifying a filter script/program using the
INPUT_FILTERoption. Then, by settingFILTER_SOURCE_FILE = YES, the filtered source code will be used in the source browser rather than the original source.From the docs:
and
As a crude example, using the following source (saved as
filter.pyin the same location as Doxyfile, and made executable):and in Doxyfile, setting:
The output source browser will now show only lines that do not start with
//.Naturally, creating a filter script that discards all C-style comments except those that are relevant to doxygen will be a lot more involved than the one shown above.