Inline Commands
An inline command works inside a sentence. Most shape a run of text, such as emphasis or a code span; the rest build links, cross-references, or pull documentation in from another symbol.
Text formatting
MrDocs reads the usual Markdown spans, with Doxygen and HTML equivalents alongside them:
-
Emphasis:
*text*or_text_. -
Strong:
**text**or__text__. -
Code span:
`text`. -
Strikethrough:
~~text~~. -
Highlight:
==text==.
/** Formats a quantity for *human* reading.
Returns a **localized** string. Pass the raw value in `cents`;
the ~~deprecated~~ `format_dollars` spelling is gone. Out-of-range
inputs are ==flagged== in the output.
*/
char const* format_money(long cents);
format_money
Formats a quantity for human reading.
Synopsis
Declared in <text‐formatting.cpp>
char const*
format_money(long cents);
Description
Returns a localized string. Pass the raw value in cents; the deprecated format_dollars spelling is gone. Out‐of‐range inputs are flagged in the output.
Links
A link uses the Markdown form [text](url), with the HTML <a> form available too.
/** A logger compatible with the
[SLF4J specification](https://www.slf4j.org).
*/
struct logger { };
logger
A logger compatible with the SLF4J specification.
Synopsis
Declared in <link.cpp>
struct logger;
Cross-references
@ref links to another symbol by its qualified name; MrDocs resolves it against the corpus and emits a working link. This is the command to reach for whenever one symbol’s documentation should point at another.
/** Triples the input. */
int triple(int x);
/** Doubles the input.
Closely related to @ref triple.
*/
int twice(int x);
triple
Triples the input.
Synopsis
Declared in <cross‐reference.cpp>
int
triple(int x);
twice
Doubles the input.
Synopsis
Declared in <cross‐reference.cpp>
int
twice(int x);
Description
Closely related to triple.
Copying documentation
When two symbols share documentation, @copydoc copies the whole comment from another symbol; @copybrief and @copydetails copy just the brief or just the description. This keeps overloads and wrappers in step with a single source of truth.
/** Encodes a byte sequence as base-64.
@param data The bytes to encode.
@param n Number of bytes in `data`.
@returns A null-terminated base-64 string. Owned by the caller.
*/
char* b64_encode(const char* data, unsigned n);
/** @copydoc b64_encode */
char* base64(const char* data, unsigned n);
b64_encode
Encodes a byte sequence as base‐64.
Synopsis
Declared in <copydoc.cpp>
char*
b64_encode(
char const* data,
unsigned int n);
Return Value
A null‐terminated base‐64 string. Owned by the caller.
Parameters
Name |
Description |
data |
The bytes to encode. |
n |
Number of bytes in |
base64
Encodes a byte sequence as base‐64.
Synopsis
Declared in <copydoc.cpp>
char*
base64(
char const* data,
unsigned int n);
Return Value
A null‐terminated base‐64 string. Owned by the caller.
Parameters
Name |
Description |
data |
The bytes to encode. |
n |
Number of bytes in |