I am using Doxygen to generate documentation for our API, written in C#. However, it exposes private/protected members. Is there a way to hide those?
I figured out how to hide files: EXCLUDE = List of file names
Yet, I need more granularity and thus shield users from unnecessary API noise. A sample Doxygen file would be appreciated as well as tips/tricks.
What tools do you use to generate API from the source code?
I feel somewhat left in the 18th century as I use Doxygen in C# by way of C++.
A few possibilities, from the doxygen manual:
HIDE_UNDOC_MEMBERS
,HIDE_UNDOC_CLASSES
: Obviously works only if you only document the public members.INTERNAL_DOCS
: Allows you to use the \internal markup to exclude comments from the "public" version of the documentation.ENABLED_SECTIONS
: Are more general version ofINTERNAL_DOCS
This works for me, to hide big chunks of code and documentation:
Run with
ENABLED_SECTIONS = PRIVATE
to create your internal version of the docs. You can have several conditions and enable/disable them according to the audience.To hide just part of a documentation block, use
\internal
(will hide until the end of the block unless\endinternal
is found)Note: you can use @ notation if you prefer it over backslashes.
Check out the @cond flag for doxygen. In C# I hide some of our password encryption members like this:
The doxygen documentation would have you believe that you need a conditional symbol defined to doxygen and used on the @cond line, but that did not work for me. This method did.
I don't know how well C# is supported by Doxygen.
For hiding private members, you change
Doxyfile
configuration file as following:Many other options can be set for various kinds of extracting/hiding code elements, e.g., citing
Doxyfile
itself: