@page Guides @subpage DocumentationGuide @page DocumentationGuide Documentation Guide
Good documentation is vital for helping to understand the code and maintain it months or even years after writing it. It saves valuable time having to try and remember and understand complex code. It also helps to describe the intent of the code which makes it easier to identify what is intended behaviour and what could be bugs in the implementation.
Documentation can be class descriptions, general module descriptions as well as user documentation. 'User' in this context could be end-user but also could be a programmer, designer, artist or others that will use the code and/or their artifacts.
If possible, place the documentation together with the code such as in a doxygen style comment inside the header file of the code so that it will be more likely to be updated when the code changes. Putting documentation all over the place in other locations and other files means that the work flow is more cumbersome to find all the files where relevant documentation exists to update it and to compare it is aligned with what the implementation is. See below for tips on using markdown and creating a new documentation page within the code in a comment.
Here is an example of how to add a new topic to document inside of source code. This could be inside a CPP or H file.
/*! @page Topics @subpage ImageHandling @page ImageHandling Image Handling Documentation about image handling */
The page command adds this topic to the Topics page as a subpage called ImageHandling. The second page commands places this in a seperately generated file that declares this subpage. The second param to page, in this example "Image Handling" is the display name of this topic.
Topic documentation can include markdown, formulas etc, as described below:
First Header | Second Header ------------- | ------------- Content Cell | Content Cell Content Cell | Content Cell
First Header | Second Header ------------- | ------------- Content Cell | Content Cell Content Cell | Content Cell
int func(int a,int b) { return a*b; }@codeint func(int a,int b) { return a*b; }@endcodeYou can include latex for including formulas.
You can include SVG directly for plotting lines and shapes.
\htmlonly
\endhtmlonly
@code \htmlonly
\endhtmlonly @endcode
\htmlonly
\endhtmlonly