Commands Reference

This page lists every doc-comment command MrDocs understands, grouped by category. See Documenting the Code for an introduction.

Notation

The Syntaxes listed for each command use these conventions:

<arg>

A required argument.

[arg]

An optional argument.

{ arg }

A Paragraph argument: free-form text that runs until a blank line or the next command.

a / b

A paired command with an opening (a) and closing (b) form.

...

A multi-line body (for example, the contents of a code or math block).

Parameter Types

Every command argument has a type that determines how MrDocs parses it. When a type is itself a documentation node it links to that node’s command; the remaining types are described here.

Paragraph

Free-form text that runs until a blank line or the next command. It may contain inline markup and references, but the command itself does nothing special with it.

Text

A span of inline text on the command’s line, with no block structure.

Symbol

The name of a C++ entity (a parameter, type, or symbol). MrDocs resolves and links it where it can.

Direction

One of in, out, or in,out.

Language

A fenced-code language tag, such as cpp.

Path

A file path or URL.

Math

A LaTeX math expression.

Code

Verbatim source lines, reproduced without markup processing.

Markup Blocks

Paragraph

Syntaxes:

  • plain prose

  • @details { text }

A paragraph is the most basic block structure in a doc comment. Any plain text that is not part of another command is treated as a paragraph. Consecutive lines of text are merged into a single paragraph; a blank line starts a new one.

The @details command is an explicit way to begin the detailed description section, but in practice you rarely need it — any text after the brief summary is already treated as detail paragraphs.

Type Parameter Description

Paragraph

text

The paragraph body. Plain prose is detected automatically; @details begins the detailed-description section explicitly.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/paragraph.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/paragraph.adoc[]

See also: Heading

Heading

Syntax: @par [title] { content }

The @par command creates a named heading (subsection) inside a doc comment. The text on the same line as @par becomes the heading title; subsequent lines form the body of that section.

Type Parameter Description

Text

title

The heading text, on the same line as @par. If omitted, no heading is emitted.

Paragraph

content

The section body, on the lines after @par.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/heading.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/heading.adoc[]

See also: Paragraph

List

Syntaxes:

  • @li { item }

  • @arg { item }

  • - (Markdown bullet)

Creates an unordered (bulleted) list inside a doc comment. You can use the Javadoc/Doxygen @li command, its alias @arg, or Markdown-style dash bullets (`- `). All three syntaxes produce the same list structure.

Type Parameter Description

Paragraph

item

The text of one list item.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/list.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/list.adoc[]

Table

Syntax: <table>

Creates a table inside a doc comment using HTML table markup. MrDocs parses standard HTML <table>, <tr>, <th>, and <td> elements and converts them to a table in the output format.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/table.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/table.adoc[]

Code Block

Syntaxes:

  • @code[{.lang}] ... @endcode

  • @verbatim …​ @endverbatim

Inserts a block of preformatted code into the documentation. Everything between the opening and closing tags is preserved verbatim, including whitespace and indentation.

@code and @verbatim produce the same output. Use @code for source code and @verbatim for other preformatted text, though MrDocs treats them identically.

Type Parameter Description

Language

lang

Optional language hint for syntax highlighting, e.g. cpp.

Code

code

The verbatim source between the opening command and @endcode/@endverbatim.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/code-block.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/code-block.adoc[]

Admonitions

Syntaxes:

  • @note { text }

  • @warning { text }

  • @tip { text }

  • @important { text }

  • @caution { text }

Admonition commands wrap a paragraph in a callout block. The five kinds differ in urgency:

  • @note — supplementary information the reader should be aware of.

  • @tip — a helpful suggestion or best practice.

  • @important — information critical to correct usage.

  • @warning — something that could lead to unexpected behavior if ignored.

  • @caution — something that could cause data loss, security issues, or other serious problems.

The text following the command becomes the body of the admonition block.

Type Parameter Description

Paragraph

text

The admonition body.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/admonitions.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/admonitions.adoc[]

Quote

Syntax: > text

The AST defines a Quote node, but no parser path produces it yet. When that lands, it will hold a blockquote inside a doc comment.

Type Parameter Description

Paragraph

text

The quoted text; prefix each line with >.

Not yet supported: MrDocs does not yet produce correct output for this command.

See also: Paragraph

Thematic Break

Syntaxes:

  • ---

  • ***

  • ___

The AST defines a ThematicBreak node, but no parser path produces it yet. When that lands, it will render as a horizontal rule between doc-comment sections.

Not yet supported: MrDocs does not yet produce correct output for this command.

See also: Heading

Definition List

Syntax: term : definition

The AST defines a DefinitionList node, but no parser path produces it yet. When that lands, it will hold a definition list of term-description pairs.

Type Parameter Description

Text

term

The term being defined.

Paragraph

definition

A definition, on a line prefixed with :.

Not yet supported: MrDocs does not yet produce correct output for this command.

See also: List

Footnote Definition

Syntax: [^label]: text

The AST defines a FootnoteDefinition node, but no parser path produces it yet. When that lands, it will hold the body of a footnote that inline content can reference.

Type Parameter Description

Text

label

The footnote identifier that references point to.

Paragraph

text

The footnote body.

Not yet supported: MrDocs does not yet produce correct output for this command.

See also: Footnote Reference

Math Block

Syntax: expression

The AST defines a block-level Math node, but no parser path produces it yet. This is the block form, separate from the inline $…​$ and ... math that already works. When that lands, it will hold a standalone math expression as its own block.

Type Parameter Description

Math

expression

A standalone LaTeX math expression.

Not yet supported: MrDocs does not yet produce correct output for this command.

See also: Math

Metadata Blocks

Summary

Syntaxes:

  • @brief { text }

  • @short { text }

The @brief command marks its content as the brief description (summary) of the documented symbol. The first sentence of a doc comment is automatically treated as the brief, so you only need @brief when you want to override that behavior or when the automatic detection does not capture what you intend.

@short is an alias for @brief.

Type Parameter Description

Paragraph

text

The brief, one-sentence summary of the symbol.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/summary.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/summary.adoc[]

See also: Paragraph

Parameters

Syntax: @param[<dir>] <name> { description }

The @param command documents a function parameter. Write one @param per parameter you want to describe. The parameter name follows the command, and everything after it is the description.

An optional direction indicator can appear in square brackets between @param and the parameter name to specify how data flows through the parameter.

Type Parameter Description

Direction

dir

Optional parameter direction.

Symbol

name

The function parameter being documented; must match the signature.

Paragraph

description

Description of the parameter.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/parameters.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/parameters.adoc[]

Template Parameters

Syntax: @tparam <name> { description }

The @tparam command documents a template parameter. It works like @param, but for type, non-type, and template-of-template parameters.

Type Parameter Description

Symbol

name

The template parameter; must match the template declaration.

Paragraph

description

Description of the template parameter.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/template-parameters.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/template-parameters.adoc[]

See also: Parameters

Returns

Syntaxes:

  • @return { description }

  • @returns { description }

  • @result { description }

The @return command documents the return value of a function. All three spellings are equivalent. You can use multiple @return commands when a function returns a composite value and you want to describe each part separately.

Type Parameter Description

Paragraph

description

Description of the return value.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/returns.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/returns.adoc[]

See also: Parameters, Exceptions

Exceptions

Syntaxes:

  • @throw <exception> { description }

  • @throws <exception> { description }

  • @exception <exception> { description }

The @throw command documents an exception that a function may throw. All three spellings are equivalent. The exception type follows the command, and the rest of the line (and continuation lines) describe when or why the exception is thrown.

Type Parameter Description

Symbol

exception

The exception type that may be thrown, e.g. std::invalid_argument.

Paragraph

description

When and why the exception is thrown.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/exceptions.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/exceptions.adoc[]

See also: Returns, Preconditions

Preconditions

Syntax: @pre { description }

The @pre command documents a precondition that must hold before calling the function. You can use multiple @pre commands to list several preconditions; each one renders as a separate bullet in a "Preconditions" section.

Type Parameter Description

Paragraph

description

A condition that must hold before the call.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/preconditions.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/preconditions.adoc[]

Postconditions

Syntax: @post { description }

The @post command documents a postcondition that is guaranteed after the function returns successfully. Like @pre, you can use multiple @post commands to list several postconditions; each renders as a separate bullet in a "Postconditions" section.

Type Parameter Description

Paragraph

description

A condition guaranteed after the call.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/postconditions.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/postconditions.adoc[]

See also: Preconditions

See-also

Syntaxes:

  • @see { references }

  • @sa { references }

The @see command adds an entry to the "See also" section of the documented symbol. The argument is parsed as inline content, so you can include cross-references, links, or plain text. Multiple @see commands produce multiple entries.

@sa is a Doxygen-compatible alias for @see.

@see looks special, but its argument is just an ordinary paragraph. MrDocs does not auto-link names inside it (Doxygen’s documentation is misleading on this point). To link to a symbol, use @ref inside the paragraph.

Type Parameter Description

Paragraph

references

The text shown in the See Also section. Typically references to related symbols, but parsed as an ordinary paragraph.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/see-also.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/see-also.adoc[]

See also: Cross-reference

Relates

Syntaxes:

  • @relates <name>

  • @related <name>

  • @relatedalso <name>

  • @relatesalso <name>

  • @memberof <name>

Declares that the documented free function is logically related to (or a member of) the specified class or struct. MrDocs stores each target in the symbol’s relates field and renders it under Non-Member Functions. @related, @relatedalso, and @relatesalso are aliases for @relates; @memberof behaves the same way.

Type Parameter Description

Symbol

name

The class or struct this free function is related to.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/relates.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/relates.adoc[]

Function Object

Syntaxes:

  • @functionobject

  • @functor

Marks a constexpr variable as an Algorithm Function Object (AFO) (the niebloid pattern: a callable object that stands in for a function). Place the command on the variable or on its function-object record; it never goes on operator(). MrDocs then documents the variable as a function whose signature and text come from the record’s operator() overloads, falling back to the variable’s own doc comment when operator() is undocumented. The record’s own doc comment is not used. With auto-function-objects enabled (the default) a variable whose type has only operator() overloads is detected automatically, so the command is needed only when the type has extra public members that defeat detection. @functor is an alias for @functionobject.

Document the operator(), not the variable or the record: that is where MrDocs takes the AFO’s signature and description from.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/function-object.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/function-object.adoc[]

See Below

Syntax: @seebelow

Marks the symbol so its synopsis renders as /* see below */ instead of the full declaration, for interfaces whose exact form is unspecified.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/see-below.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/see-below.adoc[]

Implementation Defined

Syntax: @implementationdefined

Marks the symbol as implementation-defined, so its details are hidden from the generated documentation.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/implementation-defined.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/implementation-defined.adoc[]

Inlines

Emphasis

Syntaxes:

  • *text*

  • _text_

  • @a <word>

  • @e <word>

  • @em <word>

  • <em>text</em>

Renders its content in italic (emphasized) style. Use * or _ around the emphasized text. The Doxygen commands @a, @e, and @em emphasize the single word that follows them.

Type Parameter Description

Text

word

The word to emphasize (command form). The Markdown/HTML forms wrap a span of text.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/emphasis.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/emphasis.adoc[]

See also: Strong

Strong

Syntaxes:

  • **text**

  • __text__

  • @b <word>

  • @strong <word>

  • <strong>text</strong>

Renders its content in bold (strong) style. Use ** or __ around the bold text. The Doxygen commands @b and @strong bold the single word that follows them.

Type Parameter Description

Text

word

The word to render bold (command form). The Markdown/HTML forms wrap a span of text.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/strong.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/strong.adoc[]

See also: Emphasis

Code Span

Syntaxes:

  • `text`

  • @c <word>

  • @p <word>

  • <code>text</code>

Renders its content in a monospace code font, inline within the surrounding text. Markdown-style backtick delimiters wrap the text to be rendered as code. The Doxygen commands @c and @p apply code formatting to the single word that follows them. The HTML <code> tag is also recognized.

Type Parameter Description

Text

word

The word to render as inline code (command form). The Markdown/HTML forms wrap a span of text.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/code-span.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/code-span.adoc[]

See also: Code Block

Strikethrough

Syntaxes:

  • ~~text~~

  • <del>text</del>

Renders its content with a horizontal line through the middle, for deleted or deprecated text. Wrap the text in double tildes (~~).

Type Parameter Description

Text

text

The text to strike through.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/strikethrough.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/strikethrough.adoc[]

Highlight

Syntaxes:

  • ==text==

  • <mark>text</mark>

Renders its content with a highlighted background, drawing attention to specific words or phrases. Markdown-style double equals signs (==) wrap the text. The HTML <mark> tag is also recognized.

Type Parameter Description

Text

text

The text to highlight.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/highlight.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/highlight.adoc[]

Superscript

Syntaxes:

  • ^text^

  • <sup>text</sup>

Renders its content as superscript, positioned above the baseline. Use for footnote markers, exponents, and ordinal indicators. Wrap the text in carets (^).

Type Parameter Description

Text

text

The text to raise as superscript.

Not yet supported: MrDocs does not yet produce correct output for this command.

See also: Subscript

Subscript

Syntaxes:

  • ~text~

  • <sub>text</sub>

Renders its content as subscript, positioned below the baseline. Use for chemical formulas, mathematical indices, and similar notation. Wrap the text in single tildes (~).

Type Parameter Description

Text

text

The text to lower as subscript.

Not yet supported: MrDocs does not yet produce correct output for this command.

See also: Superscript

Math

Syntaxes:

  • $expression$ (inline)

  • expression (display)

Renders a mathematical expression. Single dollar signs ($…​$) produce an inline math span that flows within surrounding text. Double dollar signs (...) produce a display math block, typically centered on its own line. The content between the delimiters is treated as a literal math expression and is not parsed for Markdown or other formatting.

Type Parameter Description

Math

expression

A LaTeX math expression; $…​$ inline, ... display.

Not yet supported: MrDocs does not yet produce correct output for this command.

See also: Code Span

Syntaxes:

  • [text](url)

  • <a href="url">text</a>

Creates a hyperlink to an external URL. The Markdown form puts the visible text in square brackets and the URL in parentheses. The HTML form uses an <a> tag with an href attribute.

Type Parameter Description

Text

text

The link text.

Path

url

The destination URL.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/link.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/link.adoc[]

See also: Cross-reference, Image

Image

Syntaxes:

  • ![alt](src)

  • <img src="src" alt="alt">

  • @image <format> <file> ["caption"]

Embeds an image inline. The Markdown form is an exclamation mark, alt text in square brackets, then the source path in parentheses. The HTML form uses an <img> tag with src and alt attributes.

Type Parameter Description

Text

format

Output format the image applies to, e.g. html.

Path

file

Path to the image file.

Text

caption

Optional caption.

Not yet supported: MrDocs does not yet produce correct output for this command.

See also: Link

Cross-reference

Syntaxes:

  • @ref <name> ["text"]

  • @link <name> ... @endlink

Creates a cross-reference to another documented symbol. The @ref command takes a symbol name (optionally namespace-qualified) and produces a link to that symbol’s documentation page. Qualified names use :: separators (e.g., @ref A::f1, @ref ::A::f1). Operator names are supported (e.g., @ref F::operator+).

Type Parameter Description

Symbol

name

Qualified name of the symbol to link to.

Text

text

Optional display text for the link.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/cross-reference.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/cross-reference.adoc[]

See also: Link, See-also

Footnote Reference

Syntax: [^label]

The AST defines a FootnoteReference node, but no parser path produces it yet. When that lands, it will hold an inline reference to a footnote definition.

Type Parameter Description

Text

label

The identifier of the footnote definition to reference.

Not yet supported: MrDocs does not yet produce correct output for this command.

Copy

Syntaxes:

  • @copydoc <reference>

  • @copybrief <reference>

  • @copydetails <reference>

Copy documentation from another symbol. @copydoc copies the whole doc comment (brief, description, and every metadata block); @copybrief copies only the brief; @copydetails copies only the detailed description. Useful for overloads, redeclarations, and wrappers that share documentation with another symbol.

Type Parameter Description

Symbol

reference

The symbol whose documentation to copy.

Example
Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/copydoc.cpp[]
Preview

Unresolved include directive in modules/ROOT/partials/commands/groups/reference.adoc - include::example$snippets/commands/copydoc.adoc[]

Line Break

Syntaxes:

  • <br>

  • <br/>

The <br> HTML tag marks a hard line break inside inline content. MrDocs accepts both <br> and the self-closing <br/>. The visible rendering is still being refined: the parser consumes the tag without emitting an explicit line-break element yet.

Not yet supported: MrDocs does not yet produce correct output for this command.

See also: Soft Break

Soft Break

Syntaxes:

  • newline within a paragraph

  • \ (at end of line)

The AST defines a SoftBreak node, but no parser path produces it yet. A soft break is a line break that renderers may collapse to a space, in contrast to the hard <br> break.

Not yet supported: MrDocs does not yet produce correct output for this command.

See also: Line Break