The guidelines document the current style or a recommended style for documenting OpenFOAM source code (.C and .H) files. General ~~~~~~~ - For readability in the comment blocks, certain tags are used that are translated by pre-filtering the file before sending it to doxygen. - The tags start in column 1, the contents follow on the next lines and indented by 4 spaces. The filter removes the leading 4 spaces from the following lines until the next tag that starts in column 1. - The 'Class' and 'Description' tags are the most important ones. - The first paragraph following the 'Description' will be used for the brief description, the remaining paragraphs become the detailed description. eg, |------------------------- | |Class | Foam::myClass | |Description | A class for specifying the documentation style. | | The class is implemented as a set of recommendations that may | sometimes be useful. | |------------------------- - The class name must be qualified by its namespace, otherwise doxygen will think you are documenting some other class. - If you don't have anything to say about the class (at the moment), use the namespace-qualified class name for the description. This aids with finding these under-documented classes later. eg, |------------------------- | |Class | Foam::myUnderDocumentedClass | |Description | Foam::myUnderDocumentedClass | |------------------------- - Use 'Class' and 'Namespace' tags in the header files. The Description block then applies to documenting the class. - Use 'InClass' and 'InNamespace' in the source files. The Description block then applies to documenting the file itself. eg, |------------------------- | |InClass | Foam::myClass | |Description | Implements the read and writing of files. | |------------------------- Doxygen Special Commands ~~~~~~~~~~~~~~~~~~~~~~~~ Doxygen has a large number of special commands with a '\' prefix or a (alternatively) an '@' prefix. The '@' prefix form is recommended for most doxygen specials, since it has the advantage of standing out. It also happens to be what projects like gcc and VTK are using. The '\' prefix form, however, looks a bit better for the '\n' newline command and when escaping single characters - eg, '\@', '\<', '\>', etc. Since the filtering removes the leading 4 spaces within the blocks, the doxygen commmands can be inserted within the block without problems. eg, |------------------------- | |InClass | Foam::myClass | |Description | Implements the read and writing of files. | | An example input file: | @verbatim | patchName | { | type myPatchType; | refValue 100; | value uniform 1; | } | @endverbatim | | Within the implementation, a loop over all patches is done: | @code | forAll (patches, patchI) | { | ... // some operation | } | @endcode | |------------------------- HTML Special Commands ~~~~~~~~~~~~~~~~~~~~~ Since Doxygen also handles HTML tags to a certain extent, the angle brackets need quoting in the documentation blocks. Non-HTML tags cause doxygen to complain, but seem to work anyhow. eg, The template with type