OpenOCD
|
The following sections provide guidelines for OpenOCD developers who wish to write Doxygen comments in the code or this manual.
For an introduction to Doxygen documentation, see the Doxygen Primer.
Several different types of Doxygen comments can be used; often, one style will be the most appropriate for a specific context. The following guidelines provide developers with heuristics for selecting an appropriate form and writing consistent documentation comments.
///
to for one-line documentation of instances./** * @brief First sentence is short description. Remaining text becomes * the full description block, where "empty" lines start new paragraphs. * * One can make text appear in @a italics, @b bold, @c monospace, or * in blocks such as the one in which this example appears in the Style * Guide. See the Doxygen Manual for the full list of commands. * * @param foo For a function, describe the parameters (e.g. @a foo). * @returns The value(s) returned, or possible error conditions. */
/**
.*/
, should also be on its own line.'*'
in-line with its start:'*'
with the /**
line./**<
form can be used on the same line.int field; /**< field description */
The following guidelines apply to all Doxygen comment blocks:
'@cmd'
form for all doxygen commands (do not use '\cmd'
).function_name()
can be used to reference functions (e.g. flash_set_dirty()).struct_name::member_name
should be used to reference structure fields in the documentation (e.g. flash_driver::name
).@subpage
command somewhere the page(s) under which they should be linked:@ref
in other contexts to create links to pages and sections.file names
and code symbols
, so they appear visually distinct from surrounding text.In addition to the guidelines in the preceding sections, the following additional style guidelines should be considered when writing documentation as part of standalone text files:
'*'
convention that must be used in the source code.@page
block.@file
block at the end of each Doxygen
.txt file to document its contents:doc/manual/style.txt
, which contains a reference back to itself./** @page pagename Page Title Documentation for the page. */ /** @file This file contains the @ref pagename page. */
For an example, the Doxygen source for this Style Guide can be found in doc/manual/style.txt
, alongside other parts of The Manual.