Alex exoskeleton
ALEX SoftwareDocumentation
Doxygen Style Guide

to specify a brief description ```

VSCode

Install Doxygen Document Generator

Introduction

This document is a style guide to provide best practice formatting guidelines for ALEX Software Documentation using Doxygen. As such, the guide is a compilation of material from the Doxygen Manual and the How to Write Doc Comments for the Javadoc Tool technical article. The latter document contains a Javadoc style guide which provides conventions for creating useful API documents - these conventions are included at the end of this document as an essential documentation reference.

Document Quick Links

  1. Setup for Documentation Commenting Using Doxygen
  2. Example of Documented Header File
  3. Documenting a Class
  1. Documenting Enumerated Types
  2. Documenting A Function/Method
  3. Additional (Useful) Special Commands
  4. Tables (Documenting Maps) - Markdown Support
  5. Documenting Formuli - LaTeX Support
  6. Tips From The Javadoc Style Guide

Doxygen Configuration File

```c++ CPP_CLI_SUPPORT = YES //Parsing Support for C++/CLI language JAVADOC_AUTOBRIEF = NO //Explicitly useUsing the default settings, Doxygen Document Generator automatically creates a doc comment block when you type /**

Visual Studio

Using Visual Studio Preview Version 16.6.0 Preview 5.0

To switch to Doxygen, type “Doxygen” in the Ctrl+Q search box, or go to Tools > Options > Text Editor > C/C++ > > General, and choose your preferred documentation style: Doxygen(/**)

Source: Doxygen and XML Doc Comment Support

Doc Comment Block Prototype

Part-example of Documented Drive.h

Function Special Commands

Function Command Decription Doxygen Manual Link
\param Used to describe a function parameter command
\return Used to describe the function return variable command
\sa Used to refer to associated functions, may be used to avoid unnecessary repitition command

The following tips (sourced from the Javadoc Style Guide) provide convention for using \param and \return:

### Function Description Prototype

1 {c++}
2 /**
3  * This is description which ends with a dot if *_AUTOBRIEF = YES
4  *
5  * This is a detailed description indicated by a space between a brief
6  * and detailed description
7  * \param a an integer
8  * \return the result
9  * \sa anotherFunction()
10  */
11  int testComment(int a);

Source: Doxygen Manual

1 {c++}
2 /**
3  * An enum type.
4  * The documentation block cannot be put after the enum!
5  */
6  enum EnumType
7  {
8  int Eval1, /**< enum value 1 */
9  int Eval2, /**< enum value 2 */
10  };

Doxygen Output - Documenting Enum Type

Using In-line Comments to Display an Enum Table /**< enum value 1 */ represents an inline comment. This comment is placed after the member it refers to, this association is indicated by < symbol in the comment description. Here, the placement of in-line comments associated the enum variable Eval1 with its value 1 and Doxygen creates an enum table from these associations.

Function Command Decription Doxygen Manual Link
@code Starts a code block. A code block is interpreted as source code. Names of class, members, and other documented entities are replaced by links to the documentation. Use with \endcode command
\b<word> Displays the argument <word> in bold font. Equivalent to HTML <b>multiple words</b> command \e<word> Displays the argument <word> in italic font. Equivalent to HTML <em>multiple words</em> command \details Starts the detail description. Alternatively, a detailed description is started with a new paragraph (after a blank line) command
\todo Starts a paragraph where a TODO item is described. The description will also add an item to a separate TODO list. command
\test Starts a paragraph where a test case can be described. The description will also add the test case to a separate test list. command

|\bug| |\deprecated|

Doxygen supports the use of Markdown to create tables in the doc comments. These should be used to document mappings (key-value pairs) when an enum type is not used. See the example below:

1 {c++}
2 /**
3  * First Header | Second Header
4  * ------------ | -------------
5  * Content Cell | Content Cell
6  * Content Cell | Content Cell
7  */

For column alignment, one or two colons (:) can be used to select the type of alignment in the header seperator line. See the example below:

1 {c++}
2  /**
3  * | Right | Center | Left |
4  * | ----: | :----: | :----|
5  * | value | value | value|
6  */

Doxygen supports the use of LaTeX commands to document formulas. See the example below.

Function Command Decription Doxygen Manual Link
\f$ Used to insert an in-line formula in a paragraph. End with \f$ $ command

| f[ ... \f] or \f{ ... }{ ...\f}| Used to insert column-centered and multi-line formulas into paragraph.

```c++ /**

Tag Conventions - Note: The equivalent Doxygen commands will be used in place of Javadoc commands (@ replaced by \) Order of Tags - Include tags in the following order

  1. \author (classes and interfaces only, required)
  2. \version (classes and interfaces only, required)
  3. \param (methods and constructors only)
  4. \return (methods only)
  5. \exception(\throws is a synonym)
  6. \sa or \see\