How to integrate examples with Doxygen?

Tobi Weißhaar picture Tobi Weißhaar · Jan 24, 2012 · Viewed 45.4k times · Source

I documented all of my classes and now I want to integrate an example of how to use these classes. How do I do that?

Answer

Loebl picture Loebl · Jan 24, 2012

You can put example source code in a special path defined in the doxygen config under EXAMPLE_PATH, and then insert examples with the @example tag.

Doxygen will then generate an extra page containing the source of the example. It will also set a link to it from the class documentation containing the example tag.

Alternatively if you want to use small code snippets you can insert them with @code ... @endcode

The documentation for this is here: doxygen documentation?