@code tag
These tags insert a piece of code which must be ended by an @end code tag.
The following optional flags are available:
C : Use C/C++ syntax coloring (default).
M : Use mkdoc syntax coloring, @ is escape character.
R : Don't use syntax coloring.
N : Show line numbers.
L : Do not insert links for known C/C++ identifiers.
An additional C++ scope name may be specified for identifiers lookup. The current code scope or global scope for plain documentation is used by default.
The @example tag can be used to insert code from an external file.
See also @scope tag section.
Syntax
@code <some verbatim text on one line> @end code
@code [<flags>] [{<scope>}]
<some verbatim text spanning multiple lines>
@end codeExamples
Insertion of C code, reference to bar function will be clickable if the identifier has documentation:
@code
int foo()
{
return bar() + 42;
}
@end codeInsertion of shell command invocation, no coloring used:
@code R
$ cd src
$ ls
foo.c foo.h
@end codeInsertion of C++ code, lookup from Foo::Bar scope for identifiers coloring:
@code {Foo::Bar}
return foo(a, b, c) + bar();
@end code