Doxygen C++ theme
A modern, mobile-friendly drop-in replacement for the stock Doxygen HTML output, with a first-class search functionality. Generated from Doxygen-produced XML files, filenames and URLs are fully compatible with the stock output to avoid broken links once you switch.
Basic usage
The base is contained in a single Python script and related style/template
files, for advanced features such as math rendering it’ll make use of internals
of some m.css plugins. Clone
the m.css GitHub repository and look
into the documentation/
directory:
git clone https://github.com/mosra/m.css
cd m.css/documentation
The script requires Python 3.6, depends on Jinja2
for templating and Pygments for code block
highlighting. You can install the dependencies via pip
or your distribution
package manager:
# You may need sudo here
pip3 install jinja2 Pygments
If your documentation includes math formulas, in addition you need some LaTeX distribution installed. Use your distribution package manager, for example on Ubuntu:
sudo apt install \ texlive-base \ texlive-latex-extra \ texlive-fonts-extra \ texlive-fonts-recommended
Now, in order to preserve your original Doxygen configuration, create a new
Doxyfile-mcss
file next to your original Doxyfile
and put the following
inside:
@INCLUDE = Doxyfile GENERATE_HTML = NO GENERATE_XML = YES XML_PROGRAMLISTING = NO
This will derive the configuration from the original Doxyfile
, disables
builtin Doxygen HTML output and enables XML output instead, with some unneeded
features disabled for faster processing. Now run doxygen.py
and point it
to your Doxyfile-mcss
:
./doxygen.py path/to/your/Doxyfile-mcss
It will run doxygen
to generate the XML output, processes it and generates
the HTML output in the configured output directory. After the script is done,
just open generated index.html
to see the result.
If you see something unexpected or not see something expected, check the Troubleshooting section below.
Features
In addition to features shared by all doc generators:
- Modern, valid, mobile-friendly HTML5 markup without table layouts
- URLs fully compatible with stock Doxygen HTML output to preserve existing links
- Focused on presenting the actual written documentation while reducing questionable auto-generated content
Important differences to stock HTML output
- Detailed description is put first and foremost on a page, before the member listing
- Files, directories and symbols that don’t have any documentation are not
present in the output at all. This is done in order to encourage good
documentation practices — having the output consist of an actual
human-written documentation instead of just autogenerated lists. If you
really want to have them included in the output, you can enable them
using a default-to-off
SHOW_UNDOCUMENTED
option inconf.py
(orM_SHOW_UNDOCUMENTED
in theDoxyfile
), but there are some tradeoffs. See Showing undocumented symbols and files for more information. - Table of contents is generated for compound references as well, containing all sections of detailed description together with anchors to member listings
- Private members and anonymous namespaces are always ignored, however private virtual functions are listed in case they are documented. See Private virtual functions for more information.
- Inner classes are listed in the public/protected type sections instead of being listed in a separate section ignoring their public/private status
- Class references contain also their template specification on the linked page
- Function signatures don’t contain
constexpr
andnoexcept
anymore. These keywords are instead added as flags to the function description together withvirtual
ness,explicit
ity andoverride
/final
status. On the other hand, important properties likestatic
,const
and r-value overloads are part of function signature. - For better visual alignment, function listing is done using the C++11
trailing return type (
auto
in front) and typedef listing is done withusing
). However, the detailed documentation is kept in the original form. - Function and macro parameters and enum values are vertically aligned in the member listing for better readability
- Default class template parameters are not needlessly repeated in each member detailed docs
- Deprecation markers are propagated to member and compound listing pages and
search results;
delete
d functions are marked in search as well - Information about which file to
#include
for given symbol is provided also for namespaces, free and related functions, enums, typedefs and variables. See Include files for more information.
Intentionally unsupported features
The theme is deliberately only for C and C++. See the Python documentation generator for a dedicated tool handling Python. Other languages such as C# or Java would be also better handled using dedicated tools that can make use of reflection features built into the language itself instead of attempting to (badly) parse the sources, plus a dedicated tool can better adjust to specifics of given language, such as not calling Python or Java packages “namespaces”.
Features that I don’t see a point in because they just artificially inflate the amount of generated content for no added value:
- Class hierarchy graphs are ignored (it only inflates the documentation with little added value)
- Alphabetical list of symbols and alphabetical list of all members of a class is not created (the API should be organized in a way that makes this unnecessary, there’s also search for this)
- Verbatim listing of parsed headers, “Includes” and “Included By” lists are not present (use your IDE or GitHub instead)
- Initializers of defines and variables are unconditionally ignored (one can always look in the sources, if really needed)
- No section with list of examples or linking from function/class documentation to related example code (he example code should be accompanied with corresponding tutorial page instead)
inline
functions are not marked as such (I see it as an unimportant implementation detail)- The
CREATE_SUBDIRS
Doxyfile option is not supported. This option causes Doxygen to scatter the XML files across numerous subdirectories to work around limits of ancient filesystems. Implementing support for this option would be too much effort for too little gain and so m.css simply aborts if it discovers this option being enabled. Set it back toNO
it in yourDoxyfile-mcss
override. - The
SHOW_NAMESPACES = NO
Doxyfile option is not supported as the theme provides a much more flexible configuration of what’s shown in the top navbar. See Navbar links for more information.
Not yet implemented features
- Clickable symbols in code snippets. Doxygen has quite a lot of false positives while a lot of symbols stay unmatched. I need to find a way around that.
- Documented friend classes, structs and unions. Doxygen is unable to cross-link the declarations with the definitions.
- Proper scoping for friend and related functions/classes/variables etc. Doxygen doesn’t provide any namespace scoping for these and at the moment I have no way to deduct that information.
- APIs listed in file documentation pages lose all namespace information (and when it appears in search, it’s prefixed with the file name instead of the namespace). This is due to several bugs on Doxygen side, which still need to be patched (or worked around).
Configuration
The script takes a part of the configuration from the Doxyfile
itself,
(ab)using the following builtin options:
Variable | Description |
---|---|
@INCLUDE |
Includes in Doxyfile s are supported |
PROJECT_NAME |
Rendered in top navbar, footer fine print and page title |
PROJECT_BRIEF |
If set, appended in a thinner font to
PROJECT_NAME |
PROJECT_LOGO |
URL of an image file to use as a log in the top navbar. Default is none. |
OUTPUT_DIRECTORY |
Used to discover where Doxygen generates the files |
XML_OUTPUT |
Used to discover where Doxygen puts the generated XML |
HTML_OUTPUT |
The output will be written here |
TAGFILES |
Used to discover what base URL to prepend to external references |
DOT_FONTNAME |
Font name to use for @dot and @dotfile
commands. To ensure consistent look with the
default m.css themes, set it to
Source Sans Pro . Doxygen default is
Helvetica . |
DOT_FONTSIZE |
Font size to use for @dot and @dotfile
commands. To ensure consistent look with the
default m.css themes, set it to 16 .
Doxygen default is 10 . |
SHOW_INCLUDE_FILES |
Whether to show corresponding #include
file for classes, namespaces and namespace
members. Originally SHOW_INCLUDE_FILES
is meant to be for “a list of the files that
are included by a file in the documentation of
that file” but that kind of information is
glaringly useless in every imaginable way and
thus the theme is reusing it for something
actually useful. Doxygen default is YES . |
STRIP_FROM_PATH |
Prefix to strip from directory and file paths shown in page titles. |
STRIP_FROM_INC_PATH |
Prefix to strip from paths of #include
files shown for classes, namespaces and
namespace members. Often set to the same value
as STRIP_FROM_INC_PATH . Note that you
have to set this option to something non-empty
if you’re using header name overrides in the
@class
command — otherwise Doxygen strips all
directory information from include files which
m.css then has no way of restoring. |
On top of the above, the script can take additional options in a way consistent
with the Python documentation generator.
The recommended and most flexible way is to create a conf.py
file
referencing the original Doxyfile:
DOXYFILE = 'Doxyfile-mcss' # additional options from the table below
and then pass that file to the script, instead of the original Doxyfile:
./doxygen.py path/to/your/conf.py
Variable | Description |
---|---|
MAIN_PROJECT_URL: str |
If set and PROJECT_BRIEF is also
set, then PROJECT_NAME in the top
navbar will link to this URL and
PROJECT_BRIEF to the documentation
main page, similarly as shown here. |
THEME_COLOR: str |
Color for <meta name="theme-color" /> ,
corresponding to the CSS style. If not set,
no <meta> tag is rendered. See
Theme selection for more information. |
FAVICON: str |
Favicon URL, used to populate
<link rel="icon" /> . If empty, no
<link> tag is rendered. Relative
paths are searched relative to the
config file
base dir and to the doxygen.py script
dir as a fallback. See Theme selection
for more information. |
STYLESHEETS: List[str] |
List of CSS files to include. Relative
paths are searched relative to the
config file
base dir and to the doxygen.py script
dir as a fallback. See Theme selection
for more information. |
HTML_HEADER: str |
HTML code to put at the end of the
<head> element. Useful for linking
arbitrary JavaScript code or, for example,
adding <link> CSS stylesheets with
additional properties and IDs that are
otherwise not possible with just
HTML_EXTRA_STYLESHEET |
EXTRA_FILES: List[str] |
List of extra files to copy (for example
additional CSS files that are @import ed
from the primary one). Relative paths are
searched relative to the
config file
base dir and to the doxygen.py script
dir as a fallback. |
LINKS_NAVBAR1: List[Any] |
Left navbar column links. See Navbar links for more information. |
LINKS_NAVBAR2: List[Any] |
Right navbar column links. See Navbar links for more information. |
PAGE_HEADER: str |
HTML code to put at the top of every page.
Useful for example to link to different
versions of the same documentation. The
{filename} placeholder is replaced with
current file name. |
FINE_PRINT: str |
HTML code to put into the footer. If not
set, a default generic text is used. If
empty, no footer is rendered at all. The
{doxygen_version} placeholder is
replaced with Doxygen version that
generated the input XML files. |
CLASS_INDEX_EXPAND_LEVELS |
How many levels of the class tree to
expand. 0 means only the top-level
symbols are shown. If not set, 1 is
used. |
CLASS_INDEX_EXPAND_INNER |
Whether to expand inner types (e.g. a class
inside a class) in the symbol tree. If not
set, False is used. |
FILE_INDEX_EXPAND_LEVELS |
How many levels of the file tree to expand.
0 means only the top-level dirs/files
are shown. If not set, 1 is used. |
SEARCH_DISABLED: bool |
Disable search functionality. If this
option is set, no search data is compiled
and the rendered HTML does not contain any
search-related UI or support. If not set,
False is used. |
SEARCH_DOWNLOAD_BINARY |
Download search data as a binary to save
bandwidth and initial processing time. If
not set, False is used. See
Search options for more information. |
SEARCH_FILENAME_PREFIX: str |
Search data filename prefix. Useful to
prevent file conflicts if both C++ and
Python documentation shares the same
directory. If not set, searchdata is
used. |
SEARCH_RESULT_ID_BYTES: int |
Search data packing option. A value of
2 , 3 or 4 is allowed. If
not set, 2 is used. See
Search options for more information. |
SEARCH_FILE_OFFSET_BYTES: int |
Search data packing option. A value of
3 or 4 is allowed. If not set,
3 is used. See Search options for
more information. |
SEARCH_NAME_SIZE_BYTES: int |
Search data packing option. A value of
1 or 2 is allowed. If not set,
1 is used. See Search options for
more information. |
SEARCH_HELP: str |
HTML code to display as help text on empty
search popup. If not set, a default message
is used. Has effect only if
SEARCH_DISABLED is not True . |
SEARCH_BASE_URL: str |
Base URL for OpenSearch-based search engine
suggestions for web browsers. See
Search options for more information. Has
effect only if SEARCH_DISABLED is
not True . |
SEARCH_EXTERNAL_URL: str |
URL for external search. The {query}
placeholder is replaced with urlencoded
search string. If not set, no external
search is offered. See Search options
for more information. Has effect only if
SEARCH_DISABLED is not True . |
VERSION_LABELS: bool |
Show the @since annotation as labels
visible in entry listing and detailed docs.
Defaults to False , see Version labels
for more information. |
SHOW_UNDOCUMENTED: bool |
Include undocumented symbols, files and
directories in the output. If not set,
False is used. See Showing undocumented symbols and files
for more information. |
M_MATH_CACHE_FILE |
File to cache rendered math formulas. If
not set, m.math.cache file in the
output directory is used. Equivalent to an
option of the same name in the
m.math plugin. |
M_MATH_RENDER_AS_CODE |
Don’t invoke LaTex and render math as inline code and code blocks. Equivalent to an option of the same name in the m.math plugin. |
M_CODE_FILTERS_PRE: Dict |
Filters to apply before a code snippet is rendered. Equivalent to an option of the same name in the m.code plugin. Note that due to the limitations of Doxygen markup, named filters are not supported. |
M_CODE_FILTERS_POST: Dict |
Filters to apply after a code snippet is rendered. Equivalent to an option of the same name in the m.code plugin. Note that due to the limitations of Doxygen markup, named filters are not supported. |
Note that namespace, directory and page lists are always fully expanded as these are not expected to be excessively large.
Theme selection
By default, the dark m.css theme together with documentation-theme-specific additions is used, which corresponds to the following configuration:
STYLESHEETS = [ 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600', '../css/m-dark+documentation.compiled.css' ] THEME_COLOR = '#22272e' FAVICON = 'favicon-dark.png'
If you have a site already using the m-dark.compiled.css
file, there’s
another file called m-dark.documentation.compiled.css
, which contains just
the documentation-theme-specific additions so you can reuse the already cached
m-dark.compiled.css
file from your main site:
STYLESHEETS = [ 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600', '../css/m-dark.compiled.css', '../css/m-dark.documentation.compiled.css' ] THEME_COLOR = '#22272e' FAVICON = 'favicon-dark.png'
If you prefer the light m.css theme
instead, use the following configuration (and, similarly, you can use
m-light.compiled.css
together with m-light.documentation.compiled-css
in place of m-light+documentation.compiled.css
:
STYLESHEETS = [ 'https://fonts.googleapis.com/css?family=Libre+Baskerville:400,400i,700,700i%7CSource+Code+Pro:400,400i,600', '../css/m-light+documentation.compiled.css' ] THEME_COLOR = '#cb4b16' FAVICON = 'favicon-light.png'
See the CSS files section below for more information about customizing the CSS files.
Search options
Symbol search is implemented using JavaScript Typed Arrays and does not need any server-side functionality to perform well — the client automatically downloads a tightly packed binary containing search data and performs search directly on it.
However, due to restrictions of Chromium-based browsers,
it’s not possible to download data using XMLHttpRequest
when served from
a local file-system. Because of that, the search defaults to producing a
Base85-encoded representation of the search binary and loading that
asynchronously as a plain JavaScript file. This results in the search data
being 25% larger, but since this is for serving from a local filesystem, it’s
not considered a problem. If your docs are accessed through a server (or you
don’t need Chrome support), enable the SEARCH_DOWNLOAD_BINARY
option.
The site can provide search engine metadata using the OpenSearch
specification. On supported browsers this means you can add the search field to
search engines and search directly from the address bar. To enable search
engine metadata, point SEARCH_BASE_URL
to base URL of your documentation,
for example:
SEARCH_BASE_URL = "https://doc.magnum.graphics/magnum/"
In general, even without the above setting, appending ?q={query}#search
to
the URL will directly open the search popup with results for {query}
.
If SEARCH_EXTERNAL_URL
is specified, full-text search using an external
search engine is offered if nothing is found for given string or if the user
has JavaScript disabled. It’s recommended to restrict the search to a
particular domain or add additional keywords to the search query to filter out
irrelevant results. Example, using Google search engine and restricting the
search to a subdomain:
SEARCH_EXTERNAL_URL = "https://google.com/search?q=site:doc.magnum.graphics+{query}"
The search binary is implicitly made with the tightest packing possible for smallest download sizes. On large projects with tens of thousands of symbols it may however happen that the data won’t fit and doc generation fails with an exception such as the following, suggesting you to increase the packed type sizes:
OverflowError: Trie result ID too large to store in 16 bits, set SEARCH_RESULT_ID_BYTES = 3 in your conf.py.
The relevant configuration is SEARCH_RESULT_ID_BYTES
,
SEARCH_FILE_OFFSET_BYTES
and SEARCH_NAME_SIZE_BYTES
. Simply update
your conf.py
with suggested values (or the Doxyfile-mcss
with this
option prefixed with M_
) and restart the generator. Due to the way the
search data get processed during serialization it’s unfortunately not feasible
to estimate the packing sizes beforehand.
Showing undocumented symbols and files
As noted in Features, the main design decision of the m.css Doxygen theme is to reduce the amount of useless output. A plain list of undocumented APIs also counts as useless output, so by default everything that’s not documented is not shown.
In some cases, however, it might be desirable to show undocumented symbols as
well — for example when converting an existing project from vanilla Doxygen
to m.css, not all APIs might be documented yet and thus the output would be
incomplete. The SHOW_UNDOCUMENTED
option in conf.py
(or
M_SHOW_UNDOCUMENTED
in the Doxyfile
) unconditionally makes all
undocumented symbols, files and directories “appear documented”. Note, however,
that Doxygen itself doesn’t allow to link to undocumented symbols and so even
though the undocumented symbols are present in the output, nothing is able to
reference them, causing very questionable usability of such approach. A
potential “fix” to this is enabling the EXTRACT_ALL
Doxyfile option, but
that exposes all symbols, including private and file-local ones — which, most
probably, is not what you want.
If you have namespaces not documented, Doxygen will by put function docs into
file pages — but it doesn’t put them into the XML output, meaning all links
to them will lead nowhere and the functions won’t appear in search either.
To fix this, enable the XML_NS_MEMB_FILE_SCOPE
Doxyfile option as
described in the Namespace members in file scope section below; if you
document all namespaces this problem will go away as well.
Content
Brief and detailed description is parsed as-is with the following modifications:
- Function parameter documentation, return value documentation, template parameter and exception documentation is extracted out of the text flow to allow for more flexible styling. It’s also reordered to match parameter order and warnings are emitted if there are mismatches.
- To make text content wrap better on narrow screens,
<wbr/>
tags are added after::
and_
in long symbols in link titles and after/
in URLs.
Single-paragraph list items, function parameter description, table cell content
and return value documentation is stripped from the enclosing <p>
tag
to make the output more compact. If multiple paragraphs are present, nothing is
stripped. In case of lists, they are then rendered in an inflated form.
However, in order to achieve even spacing also with single-paragraph items,
it’s needed use some explicit markup. Adding <p></p>
to a
single-paragraph item will make sure the enclosing <p>
is not stripped.
Images and figures
To match the stock HTML output, images that are marked with html
target are
used. If image name is present, the image is rendered as a figure with caption.
It’s possible affect width/height of the image using the sizespec
parameter
(unlike stock Doxygen, which makes use of this field only for LaTeX output and
ignores it for HTML output). The parameter is converted to an inline CSS
width
or height
property, so the value has to contain the units
as well:
/** @image image.png width=250px */
Dot graphs
Grapviz dot
graphs from the @dot
and @dotfile
commands are rendered
as an inline SVG. Graph name and the sizespec
works equivalently to the
Images and figures. In order to be consistent with the theme, set a matching
font name and size in the Doxyfile — these values match the default dark
theme:
DOT_FONTNAME = Source Sans Pro DOT_FONTSIZE = 16.0 # Required to be explicitly set since Doxygen 1.9.2, otherwise the graphs # won't be included in the output HAVE_DOT = YES
See documentation of the m.dot plugin for detailed information about behavior and supported features.
Pages, sections and table of contents
Table of contents is unconditionally generated for all compound documentation
pages and includes both @section
blocks in the detailed documentation as
well as the reference sections. If your documentation is using Markdown-style
headers (prefixed with ##
, for example), the script is not able to generate
TOC entries for these. Upon encountering them, tt will warn and suggest to use
the @section
command instead.
Table of contents for pages is generated only if they specify
@tableofcontents
in their documentation block.
Namespace members in file scope
Doxygen by default doesn’t render namespace members for file documentation in
its XML output. To match the behavior of stock HTML output, enable the
XML_NS_MEMB_FILE_SCOPE
Doxyfile option:
XML_NS_MEMB_FILE_SCOPE = YES
Please note that APIs listed in file documentation pages lose all namespace information (and when it appears in search, it’s prefixed with the file name instead of the namespace). This is due to several bugs on Doxygen side, which still need to be patched (or worked around).
Private virtual functions
Private virtual functions, if documented, are shown in the output as well, so
codebases can properly follow (Virtuality guidelines by Herb Sutter)
To avoid also undocumented override
s showing in the output, you may
want to disable the INHERIT_DOCS
Doxyfile option (which is enabled by
default). Also, please note that while privates are currently unconditionally
exported to the XML output, Doxygen doesn’t allow linking to them by default
and you have to enable the EXTRACT_PRIV_VIRTUAL
Doxyfile option:
INHERIT_DOCS = NO EXTRACT_PRIV_VIRTUAL = YES
Inline namespaces
inline namespace
s are marked as such in class/namespace index pages,
namespace documentation pages and nested namespace lists. Doxygen additionally
flattens those, so their contents appear in the parent namespace as well.
Include files
Doxygen by default shows corresponding #include
s only for classes. The
m.css Doxygen theme shows it also for namespaces, free functions, enums,
typedefs, variables and #define
s. The rules are:
- For classes,
#include
information is always shown on the top - If a namespace doesn’t contain any inner namespaces or classes and consists
only of functions (enums, typedefs, variables) that are all declared in the
same header file, the
#include
information is shown only globally at the top, similarly to classes - If a namespace contains inner classes/namespaces, or is spread over multiple
headers, the
#include
information is shown locally for each member - Files don’t show any include information, as it is known implicitly
- In case of modules (grouped using
@defgroup
), the#include
info is always shown locally for each member. This includes also#define
s. - In case of enums, typedefs, variables, functions and defines
@related
to some class, these also have the#include
shown in case it’s different from the classinclude
.
This feature is enabled by default, disable SHOW_INCLUDE_FILES
in the
Doxyfile to hide all #include
-related information:
SHOW_INCLUDE_FILES = NO
Code highlighting
Every code snippet should be annotated with language-specific extension like in
the example below. If not, the theme will assume C++ and emit a warning on
output. Language of snippets included via @include
and related commands is
autodetected from filename.
/** @code{.cpp} int main() { } @endcode */
Besides native Pygments mapping of file extensions to languages, there are the following special cases:
Filename suffix | Detected language |
---|---|
.h |
C++ (instead of C) |
.h.cmake |
C++ (instead of CMake), as this extension is often used for C++ headers that are preprocessed with CMake |
.glsl |
GLSL. For some reason, stock Pygments detect only
.vert , .frag and .geo extensions as GLSL. |
.conf |
INI (key-value configuration files) |
.ansi |
Colored terminal output.
Use .shell-session pseudo-extension for simple
uncolored terminal output. |
.xml-jinja |
Jinja templates in XML markup (these don’t have any well-known extension otherwise) |
.html-jinja |
Jinja templates in HTML markup (these don’t have any well-known extension otherwise) |
.jinja |
Jinja templates (these don’t have any well-known extension otherwise) |
The theme has experimental support for inline code highlighting. Inline code is distinguished from code blocks using the following rules:
- Code that is delimited from surrounding paragraphs with an empty line is considered as block.
- Code that is coming from
@include
,@snippet
and related commands that paste external file content is always considered as block. - Code that is coming from
@code
and is not alone in a paragraph is considered as inline. - For compatibility reasons, if code that is detected as inline consists of more than one line, it’s rendered as code block and a warning is printed to output.
Inline highlighted code is written also using the @code
command, but as
writing things like
/** Returns @code{.cpp} Magnum::Vector2 @endcode, which is @code{.glsl} vec2 @endcode in GLSL. */
is too verbose, it’s advised to configure some aliases in your Doxyfile-mcss
.
For example, you can configure an alias for general inline code snippets and
shorter versions for commonly used languages like C++ and CMake.
ALIASES += \ "cb{1}=@code{\1}" \ "ce=@endcode" \ "cpp=@code{.cpp}" \ "cmake=@code{.cmake}"
With this in place the above could be then written simply as:
/** Returns @cpp Magnum::Vector2 @ce, which is @cb{.glsl} vec2 @ce in GLSL. */
If you need to preserve compatibility with stock Doxygen HTML output (because
it renders all @code
sections as blocks), use the following fallback
aliases in the original Doxyfile
:
ALIASES += \ "cb{1}=<tt>" \ "ce=</tt>" \ "cpp=<tt>" \ "cmake=<tt>"
Theme-specific commands
It’s possible to insert custom m.css classes into the Doxygen output. Add the
following to your Doxyfile-mcss
:
ALIASES += \ "m_div{1}=@xmlonly<mcss:div xmlns:mcss=\"http://mcss.mosra.cz/doxygen/\" mcss:class=\"\1\">@endxmlonly" \ "m_enddiv=@xmlonly</mcss:div>@endxmlonly" \ "m_span{1}=@xmlonly<mcss:span xmlns:mcss=\"http://mcss.mosra.cz/doxygen/\" mcss:class=\"\1\">@endxmlonly" \ "m_endspan=@xmlonly</mcss:span>@endxmlonly" \ "m_class{1}=@xmlonly<mcss:class xmlns:mcss=\"http://mcss.mosra.cz/doxygen/\" mcss:class=\"\1\" />@endxmlonly" \ "m_footernavigation=@xmlonly<mcss:footernavigation xmlns:mcss=\"http://mcss.mosra.cz/doxygen/\" />@endxmlonly" \ "m_examplenavigation{2}=@xmlonly<mcss:examplenavigation xmlns:mcss=\"http://mcss.mosra.cz/doxygen/\" mcss:page=\"\1\" mcss:prefix=\"\2\" />@endxmlonly" \ "m_keywords{1}=@xmlonly<mcss:search xmlns:mcss=\"http://mcss.mosra.cz/doxygen/\" mcss:keywords=\"\1\" />@endxmlonly" \ "m_keyword{3}=@xmlonly<mcss:search xmlns:mcss=\"http://mcss.mosra.cz/doxygen/\" mcss:keyword=\"\1\" mcss:title=\"\2\" mcss:suffix-length=\"\3\" />@endxmlonly" \ "m_enum_values_as_keywords=@xmlonly<mcss:search xmlns:mcss=\"http://mcss.mosra.cz/doxygen/\" mcss:enum-values-as-keywords=\"true\" />@endxmlonly"
If you need backwards compatibility with stock Doxygen HTML output, just make
the aliases empty in your original Doxyfile
. Note that you can rename the
aliases however you want to fit your naming scheme.
ALIASES += \ "m_div{1}=" \ "m_enddiv=" \ "m_span{1}=" \ "m_endspan=" \ "m_class{1}=" \ "m_footernavigation=" \ "m_examplenavigation{2}" \ "m_keywords{1}=" \ "m_keyword{3}=" \ "m_enum_values_as_keywords="
With @m_class
it’s possible to add CSS classes to the immediately following
paragraph, image, table, list or math formula block. When used before a block
such as @par
, @note
, @see
or @xrefitem
, the CSS class fully
overrides the block styling. By default .m-note
with some color and
<h4>
is used, with @m_class
before it get <h3>
for the
title and you can turn it into a block, for example:
When used inline, it affects the immediately following emphasis, strong text, link or inline math formula. Example usage:
The builtin @parblock
command can be combined with @m_class
to wrap a
block of HTML code in a <div>
and add CSS classes to it. With
@m_div
and @m_span
it’s possible to wrap individual paragraphs or
inline text in <div>
/ <span>
and add CSS classes to them
without any extra elements being added. Example usage and corresponding
rendered HTML output:
It’s possible to combine @par
with @parblock
to create blocks, notes
and other m.css components with arbitrary
contents. The @par
command visuals can be fully overridden by putting @m_class
in front, the @parblock
after will ensure everything will
belong inside. A bit recursive example:
The @m_footernavigation
command is similar to @tableofcontents
, but
across pages — if a page is a subpage of some other page and this command is
present in page detailed description, it will cause the footer of the rendered
page to contain a link to previous, parent and next page according to defined
page order.
The @m_examplenavigation
command is able to put breadcrumb navigation to
parent page(s) of @example
listings in order to make it easier for users to
return back from example source code to a tutorial page, for example. When used
in combination with @m_footernavigation
, navigation to parent page and to
prev/next file of the same example is put at the bottom of the page. The
@m_examplenavigation
command takes two arguments, first is the parent page
for this example (used to build the breadcrumb and footer navigation), second
is example path prefix (which is then stripped from page title and is also used
to discover which example files belong together). Example usage — the
@m_examplenavigation
and @m_footernavigation
commands are simply
appended the an existing @example
command.
/** @example helloworld/CMakeLists.txt @m_examplenavigation{example,helloworld/} @m_footernavigation @example helloworld/configure.h.cmake @m_examplenavigation{example,helloworld/} @m_footernavigation @example helloworld/main.cpp @m_examplenavigation{example,helloworld/} @m_footernavigation */
The purpose of @m_keywords
, @m_keyword
and @m_enum_values_as_keywords
command is to add further search keywords to given documented symbols. Use
@m_keywords
to enter whitespace-separated list of keywords. The
@m_enum_values_as_keywords
command will add initializers of given enum
values as keywords for each corresponding value, it’s ignored when not used in
enum description block. In the following example, an OpenGL wrapper API adds GL
API names as keywords for easier discoverability, so e.g. the
Texture2D::setStorage()
function is also found when typing
glTexStorage2D()
into the search field, or the Renderer::Feature::DepthTest
enum value is found when entering GL_DEPTH_TEST
:
/** * @brief Set texture storage * * @m_keywords{glTexStorage2D() glTextureStorage2D()} */ Texture2D& Texture2D::setStorage(...); /** * @brief Renderer feature * * @m_enum_values_as_keywords */ enum class RendererFeature: GLenum { /** Depth test */ DepthTest = GL_DEPTH_TEST, ... };
The @m_keyword
command is useful if you need to enter a keyword containing
spaces, the optional second and third parameter allow you to specify a
different title and suffix length. Example usage — in the first case below,
the page will be discoverable both using its primary title and using
TCB spline support, in the second and third case the two overloads of the
lerp()
function are discoverable also via mix()
, displaying
either GLSL mix() or GLSL mix(genType, genType, float) in the search
results. The last parameter is suffix length, needed to correctly highlight the
mix substring when there are additional characters at the end of the title.
If not specified, it defaults to 0
, meaning the search string is a
suffix of the title.
/** * @page splines-tcb Kochanek–Bartels spline support * @m_keyword{TCB spline support,,} */ /** * @brief Clamp a value * @m_keyword{clamp(),GLSL clamp(),} */ float lerp(float x, float y, float a); /** * @brief Clamp a value * @m_keyword{mix(),GLSL mix(genType\, genType\, float),23} */ template<class T> lerp(const T& x, const T& y, float a);
Version labels
By default, to keep compatibility with existing content, the @since
block
is rendered as a note directly in the text flow. If you enable the
M_SINCE_BADGES
option, content of the @since
block is expected to be
a single label that can optionally link to a changelog entry. The label is then
placed visibly next to given entry and detailed description as well as all
listings. Additionally, if @since
is followed by @deprecated
, it adds
version info to the deprecation notice (instead of denoting when given feature
was added) — in this case it expects just a textual info, without any label
styling. Recommended use is in combination with an alias that takes care of the
label rendering and For example (the @m_class
is the same as described in
Theme-specific commands above):
ALIASES = \ "m_class{1}=@xmlonly<mcss:class xmlns:mcss=\"http://mcss.mosra.cz/doxygen/\" mcss:class=\"\1\" />@endxmlonly" \ "m_since{2}=@since @m_class{m-label m-success m-flat} @ref changelog-\1-\2 \"since v\1.\2\"" \ "m_deprecated_since{2}=@since deprecated in v\1.\2 @deprecated"
in the Doxyfile, and the following in conf.py
:
VERSION_LABELS = True
With the above configuration, the following markup will render a
since v1.3 label leading to a page named changelog-1-3
next to both function entry and detailed docs in the first case, and a
deprecated since v1.3 label in the second case:
/** @brief Fast inverse square root @m_since{1,3} Faster than `1.0f/sqrt(a)`. */ float fastinvsqrt(float a); /** @brief Slow inverse square root Attempts to figure out the value by a binary search. @m_deprecated_since{1,3} Use @ref fastinvsqrt() instead. */ float slowinvsqrt(float a);
Command-line options
./doxygen.py [-h] [--templates TEMPLATES] [--wildcard WILDCARD] [--index-pages INDEX_PAGES [INDEX_PAGES ...]] [--no-doxygen] [--search-no-subtree-merging] [--search-no-lookahead-barriers] [--search-no-prefix-merging] [--sort-globbed-files] [--debug] config
Arguments:
config
— where the Doxyfile or conf.py is
Options:
-h
,--help
— show this help message and exit--templates TEMPLATES
— template directory. Defaults to thetemplates/doxygen/
subdirectory if not set.--wildcard WILDCARD
— only process files matching the wildcard. Useful for debugging to speed up / restrict the processing to a subset of files. Defaults to*.xml
if not set.--index-pages INDEX_PAGES [INDEX_PAGES ...]
— index page templates. By default, if not set, the index pages are matching stock Doxygen, i.e.annotated.html
,files.html
,modules.html
,namespaces.html
andpages.html
. See Navigation page templates section below for more information.--no-doxygen
— don’t run Doxygen before. By default Doxygen is run before the script to refresh the generated XML output.--search-no-subtree-merging
— don’t optimize search data size by merging subtrees--search-no-lookahead-barriers
— don’t insert search lookahead barriers that improve search result relevance--search-no-prefix-merging
— don’t merge search result prefixes--sort-globbed-files
— sort globbed files for better reproducibility--debug
— verbose logging output. Useful for debugging.
Troubleshooting
Generated output is (mostly) empty
As stated in the Features section above; files, directories and symbols with no documentation are not present in the output at all. In particular, when all your sources are under a subdirectory and/or a namespace and that subdirectory / namespace is not documented, the file / symbol tree will not show anything.
A simple @brief
entry is enough to fix this. For example, if you have a
MorningCoffee::CleanCup
class that’s available from
#include <MorningCoffee/CleanCup.h>
, these documentation blocks are
enough to have the directory, file, namespace and also the class appear in the
file / symbol tree:
/** @dir MorningCoffee * @brief Namespace @ref MorningCoffee */ /** @namespace MorningCoffee * @brief The Morning Coffee library */
// CleanCup.h /** @file * @brief Class @ref CleanCup */ namespace MorningCoffee { /** * @brief A clean cup */ class CleanCup { ...
To help you debugging this, run doxygen.py
with the --debug
option.
and look for entries that look like below. Because there are many false
positives, this information is not present in the non-verbose output.
DEBUG:root:dir_22305cb0964bbe63c21991dd2265ce48.xml: neither brief nor detailed description present, skipping
Alternatively, there’s a possibility to just show everything, however that may include also things you don’t want to have shown. See Showing undocumented symbols and files for more information.
Output is not styled
If your Doxyfile
contains a non-empty HTML_EXTRA_STYLESHEET
option,
m.css will use CSS files from there instead of the builtin ones. Either
override it to an empty value in your Doxyfile-mcss
or specify proper CSS
files explicitly as mentioned in the Theme selection section.
Generating takes too long, crashes, asserts or generally fails
The XML output generated by Doxygen is underspecified and unnecessarily complex, so it might very well happen that your documentation triggers some untested code path. The script is designed to fail early and hard instead of silently continuing and producing wrong output — if you see an assertion failure or a crash or things seem to be stuck, you can do the following:
- Re-run the script with the
--debug
option. That will list what XML file is being processed at the moment and helps you narrow down the issue to a particular file. - At the moment, math formula rendering is not batched and takes very long, as LaTeX is started separately for every occurrence. Help in this area is welcome.
- Try with a freshly generated
Doxyfile
. If it stops happening, the problem might be related to some configuration option (but maybe also an alias or preprocessor#define
that’s not defined anymore) - m.css currently expects only C++ input. If you have Python or some other
language on input, it will get very confused very fast. This can be also
caused by a file being included by accident, restrict the
INPUT
andFILE_PATTERNS
options to prevent that. - Try to narrow the problem down to a small code snippet and submit a bug report with given snippet and all relevant info (especially Doxygen version). Or ask in the Gitter chat. If I’m not able to provide a fix right away, there’s a great chance I’ve already seen such problem and can suggest a workaround at least.
Customizing the template
The rest of the documentation explains how to customize the builtin template to better suit your needs. Each documentation file is generated from one of the template files that are bundled with the script. However, it’s possible to provide your own Jinja2 template files for customized experience as well as modify the CSS styling.
CSS files
By default, compiled CSS files are used to reduce amount of HTTP requests and
bandwidth needed for viewing the documentation. However, for easier
customization and debugging it’s better to use the unprocessed stylesheets. The
HTML_EXTRA_STYLESHEET
lists all files that go to the <link rel="stylesheet" />
in the resulting HTML markup, while HTML_EXTRA_FILES
lists the
indirectly referenced files that need to be copied to the output as well. Below
is an example configuration corresponding to the dark theme:
STYLESHEETS = [ 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600', '../css/m-dark.css', '../css/m-documentation.css' ] EXTRA_FILES = [ '../css/m-theme-dark.css', '../css/m-grid.css', '../css/m-components.css', '../css/m-layout.css', '../css/pygments-dark.css', '../css/pygments-console.css' ] THEME_COLOR = '#22272e'
After making desired changes to the source files, it’s possible to postprocess
them back to the compiled version using the postprocess.py
utility as
explained in the CSS themes
documentation. In case of the dark theme, the m-dark+documentation.compiled.css
and m-dark.documentation.compiled.css
files are produced like this:
cd css
./postprocess.py m-dark.css m-documentation.css -o m-dark+documentation.compiled.css
./postprocess.py m-dark.css m-documentation.css --no-import -o m-dark.documentation.compiled.css
Compound documentation template
For compound documentation one output HTML file corresponds to one input XML file and there are some naming conventions imposed by Doxygen.
Filename | Use |
---|---|
class.html |
Class documentation, read from class*.xml and saved
as class*.html |
dir.html |
Directory documentation, read from dir_*.xml and
saved as dir_*.html |
example.html |
Example code listing, read from *-example.xml and
saved as *-example.html |
file.html |
File documentation, read from *.xml and saved as
*.html |
namespace.html |
Namespace documentation, read from namespace*.xml
and saved as namespace*.html |
group.html |
Module documentation, read from group_*.xml
and saved as group_*.html |
page.html |
Page, read from *.xml /indexpage.xml and saved
as *.html /index.html |
struct.html |
Struct documentation, read from struct*.xml and
saved as struct*.html |
union.html |
Union documentation, read from union*.xml and saved
as union*.html |
Each template is passed a subset of the Doxyfile
and conf.py
configuration values from the Configuration tables. Most values are provided
as-is depending on their type, so either strings, booleans, or lists of
strings. The exceptions are:
- The
LINKS_NAVBAR1
andLINKS_NAVBAR2
are processed to tuples in a form(html, title, url, id, sub)
where eitherhtml
is a full HTML code for the link andtitle
,url
id
is empty; orhtml
isNone
,title
andurl
is a link title and URL andid
is compound ID (to use for highlighting active menu item). The last item,sub
is a list optionally containing sub-menu items. The sub-menu items are in a similarly formed tuple,(html, title, url, id)
. - The
FAVICON
is converted to a tuple of(url, type)
whereurl
is the favicon URL andtype
is favicon MIME type to populate thetype
attribute of<link rel="favicon" />
.
and in addition the following variables:
Variable | Description |
---|---|
FILENAME |
Name of given output file |
DOXYGEN_VERSION |
Version of Doxygen that generated given XML file |
In addition to builtin Jinja2 filters, the basename_or_url
filter returns
either a basename of file path, if the path is relative; or a full URL, if the
argument is an absolute URL. It’s useful in cases like this:
{% for css in STYLESHEETS %} <link rel="stylesheet" href="{{ css|basename_or_url }}" /> {% endfor %}
The actual page contents are provided in a compound
object, which has the
following properties. All exposed data are meant to be pasted directly to the
HTML code without any escaping.
Property | Description |
---|---|
compound.kind |
One of 'class' , 'dir' ,
'example' , 'file' ,
'group' , 'namespace' ,
'page' , 'struct' ,
'union' , used to choose a
template file from above |
compound.id |
Unique compound identifier, usually corresponding to output file name |
compound.url |
Compound URL (or where this file will be saved) |
compound.include |
Corresponding #include statement
to use given compound. Set only for
classes or namespaces that are all
defined in a single file. See
Include properties for details. |
compound.name |
Compound name |
compound.templates |
Template specification. Set only for classes. See Template properties for details. |
compound.has_template_details |
If there is a detailed documentation of template parameters |
compound.sections |
Sections of detailed description. See Navigation properties for details. |
compound.footer_navigation |
Footer navigation of a page. See Navigation properties for details. |
compound.brief |
Brief description. Can be empty. 1 |
compound.is_inline |
Whether the namespace is inline .
Set only for namespaces. |
compound.is_final |
Whether the class is final . Set
only for classes. |
compound.deprecated |
Deprecation status 7 |
compound.since |
Since which version the compound is available 8 |
compound.description |
Detailed description. Can be empty. 2 |
compound.modules |
List of submodules in this compound. Set only for modules. See Module properties for details. |
compound.dirs |
List of directories in this compound. Set only for directories. See Directory properties for details. |
compound.files |
List of files in this compound. Set only for directories and files. See File properties for details. |
compound.namespaces |
List of namespaces in this compound. Set only for files and namespaces. See Namespace properties for details. |
compound.classes |
List of classes in this compound. Set only for files and namespaces. See Class properties for details. |
compound.base_classes |
List of base classes in this compound. Set only for classes. See Class properties for details. |
compound.derived_classes |
List of derived classes in this compound. Set only for classes. See Class properties for details. |
compound.enums |
List of enums in this compound. Set only for files and namespaces. See Enum properties for details. |
compound.typedefs |
List of typedefs in this compound. Set only for files and namespaces. See Typedef properties for details. |
compound.funcs |
List of functions in this compound. Set only for files and namespaces. See Function properties for details. |
compound.vars |
List of variables in this compound. Set only for files and namespaces. See Variable properties for details. |
compound.defines |
List of defines in this compound. Set only for files. See Define properties for details. |
compound.public_types |
List of public types. Set only for classes. See Type properties for details. |
compound.public_static_funcs |
List of public static functions. Set only for classes. See Function properties for details. |
compound.public_funcs |
List of public functions. Set only for classes. See Function properties for details. |
compound.signals |
List of Qt signals. Set only for classes. See Function properties for details. |
compound.public_slots |
List of public Qt slots. Set only for classes. See Function properties for details. |
compound.public_static_vars |
List of public static variables. Set only for classes. See Variable properties for details. |
compound.public_vars |
List of public variables. Set only for classes. See Variable properties for details. |
compound.protected_types |
List of protected types. Set only for classes. See Type properties for details. |
compound.protected_static_funcs |
List of protected static functions. Set only for classes. See Function properties for details. |
compound.protected_funcs |
List of protected functions. Set only for classes. See Function properties for details. |
compound.protected_slots |
List of protected Qt slots. Set only for classes. See Function properties for details. |
compound.protected_static_vars |
List of protected static variables. Set only for classes. See Variable properties for details. |
compound.protected_vars |
List of protected variables. Set only for classes. See Variable properties for details. |
compound.private_funcs |
List of documented private virtual functions. Set only for classes. See Function properties for details. |
compound.private_slots |
List of documented private virtual Qt slots. Set only for classes. See Function properties for details. |
compound.friend_funcs |
List of documented friend functions. Set only for classes. See Function properties for details. |
compound.related |
List of related non-member symbols. Set only for classes. See Related properties for details. |
compound.groups |
List of user-defined groups in this compound. See Group properties for details. |
compound.has_enum_details |
If there is at least one enum with full description block 5 |
compound.has_typedef_details |
If there is at least one typedef with full description block 5 |
compound.has_func_details |
If there is at least one function with full description block 5 |
compound.has_var_details |
If there is at least one variable with full description block 5 |
compound.has_define_details |
If there is at least one define with full description block 5 |
compound.breadcrumb |
List of (title, URL) tuples for
breadcrumb navigation. Set only for
classes, directories, files, namespaces
and pages. |
compound.prefix_wbr |
Fully-qualified symbol prefix for given
compound with trailing :: with
<wbr/> tag before every :: .
Set only for classes, namespaces,
structs and unions; on templated
classes contains also the list of
template parameter names. |
Include properties
The compound.include
property is a tuple of (name, URL)
where
name
is the include name (together with angle brackets, quotes or a macro
name) and URL
is a URL pointing to the corresponding header documentation
file. This property is present only if the corresponding header documentation
is present. This property is present for classes; namespaces have it only when
all documented namespace contents are defined in a single file. For modules and
namespaces spread over multiple files this property is presented separately for
each enum, typedef, function, variable or define inside given module or
namespace. Directories, files and file members don’t provide this property,
since in that case the mapping to a corresponding #include
file is known
implicitly.
Module properties
The compound.modules
property contains a list of modules, where every
item has the following properties:
Property | Description |
---|---|
module.url |
URL of the file containing detailed module docs |
module.name |
Module name (just the leaf) |
module.brief |
Brief description. Can be empty. 1 |
module.deprecated |
Deprecation status 7 |
module.since |
Since which version the module is available 8 |
Directory properties
The compound.dirs
property contains a list of directories, where every
item has the following properties:
Property | Description |
---|---|
dir.url |
URL of the file containing detailed directory docs |
dir.name |
Directory name (just the leaf) |
dir.brief |
Brief description. Can be empty. 1 |
dir.deprecated |
Deprecation status 7 |
dir.since |
Since which version the directory is available 8 |
File properties
The compound.files
property contains a list of files, where every item
has the following properties:
Property | Description |
---|---|
file.url |
URL of the file containing detailed file docs |
file.name |
File name (just the leaf) |
file.brief |
Brief description. Can be empty. 1 |
file.deprecated |
Deprecation status 7 |
file.since |
Since which version the file is available 8 |
Namespace properties
The compound.namespaces
property contains a list of namespaces, where
every item has the following properties:
Property | Description |
---|---|
namespace.url |
URL of the file containing detailed namespace docs |
namespace.name |
Namespace name. Fully qualified in case it’s in a file documentation, just the leaf name if in a namespace documentation. |
namespace.brief |
Brief description. Can be empty. 1 |
namespace.deprecated |
Deprecation status 7 |
namespace.since |
Since which version the namespace is available 8 |
namespace.is_inline |
Whether this is an inline namespace |
Class properties
The compound.classes
property contains a list of classes, where every
item has the following properties:
Property | Description |
---|---|
class.kind |
One of 'class' , 'struct' , 'union' |
class.url |
URL of the file containing detailed class docs |
class.name |
Class name. Fully qualified in case it’s in a file documentation, just the leaf name if in a namespace documentation. |
class.templates |
Template specification. See Template properties for details. |
class.brief |
Brief description. Can be empty. 1 |
class.deprecated |
Deprecation status 7 |
class.since |
Since which version the class is available 8 |
class.is_protected |
Whether this is a protected base class. Set only for base classes. |
class.is_virtual |
Whether this is a virtual base class or a virtually derived class. Set only for base / derived classes. |
class.is_final |
Whether this is a final derived class. Set only for derived classes. |
Enum properties
The compound.enums
property contains a list of enums, where every item
has the following properties:
Property | Description |
---|---|
enum.base_url |
Base URL of file containing detailed description 3 |
enum.include |
Corresponding #include to get the enum
definition. Present only for enums inside
modules or inside namespaces that are spread
over multiple files.
See Include properties for more information. |
enum.id |
Identifier hash 3 |
enum.type |
Enum type or empty if implicitly typed 6 |
enum.is_strong |
If the enum is strong |
enum.name |
Enum name 4 |
enum.brief |
Brief description. Can be empty. 1 |
enum.description |
Detailed description. Can be empty. 2 |
enum.has_details |
If there is enough content for the full description block 5 |
enum.deprecated |
Deprecation status 7 |
enum.since |
Since which version the enum is available 8 |
enum.is_protected |
If the enum is protected . Set only for
member types. |
enum.values |
List of enum values |
enum.has_value_details |
If the enum values have description |
Every item of enum.values
has the following properties:
Property | Description |
---|---|
value.base_url |
Base URL of file containing detailed description 3 |
value.id |
Identifier hash 3 |
value.name |
Value name 4 |
value.initializer |
Value initializer. Can be empty. 1 |
value.deprecated |
Deprecation status 7 |
value.since |
Since which version the value is available 8 |
value.brief |
Brief description. Can be empty. 1 |
value.description |
Detailed description. Can be empty. 2 |
Typedef properties
The compound.typedefs
property contains a list of typedefs, where every
item has the following properties:
Property | Description |
---|---|
typedef.base_url |
Base URL of file containing detailed description 3 |
typedef.include |
Corresponding #include to get the
typedef declaration. Present only for
typedefs inside modules or inside
namespaces that are spread over multiple
files. See Include properties for more
information. |
typedef.id |
Identifier hash 3 |
typedef.is_using |
Whether it is a typedef or an
using |
typedef.type |
Typedef type, or what all goes before the name for function pointer typedefs 6 |
typedef.args |
Typedef arguments, or what all goes after the name for function pointer typedefs 6 |
typedef.name |
Typedef name 4 |
typedef.templates |
Template specification. Set only in case of
using . . See Template properties
for details. |
typedef.has_template_details |
If template parameters have description |
typedef.brief |
Brief description. Can be empty. 1 |
typedef.deprecated |
Deprecation status 7 |
typedef.since |
Since which version the typedef is available 8 |
typedef.description |
Detailed description. Can be empty. 2 |
typedef.has_details |
If there is enough content for the full description block 4 |
typedef.is_protected |
If the typedef is protected . Set
only for member types. |
Function properties
The commpound.funcs
, compound.public_static_funcs
,
compound.public_funcs
, compound.signals
,
compound.public_slots
, compound.protected_static_funcs
,
compound.protected_funcs
, compound.protected_slots
,
compound.private_funcs
, compound.private_slots
,
compound.friend_funcs
and compound.related_funcs
properties contain
a list of functions, where every item has the following properties:
Property | Description |
---|---|
func.base_url |
Base URL of file containing detailed description 3 |
func.include |
Corresponding #include to get the
function declaration. Present only for
functions inside modules or inside
namespaces that are spread over multiple
files. See Include properties for more
information. |
func.id |
Identifier hash 3 |
func.type |
Function return type 6 |
func.name |
Function name 4 |
func.templates |
Template specification. See Template properties for details. |
func.has_template_details |
If template parameters have description |
func.params |
List of function parameters. See below for details. |
func.has_param_details |
If function parameters have description |
func.return_value |
Return value description. Can be empty. |
func.return_values |
Description of particular return values. See below for details. |
func.exceptions |
Description of particular exception types. See below for details. |
func.brief |
Brief description. Can be empty. 1 |
func.description |
Detailed description. Can be empty. 2 |
func.has_details |
If there is enough content for the full description block 5 |
func.prefix |
Function signature prefix, containing
keywords such as static . Information
about constexpr ness,
explicit ness and
virtual ity is removed from the
prefix and available via other properties. |
func.suffix |
Function signature suffix, containing
keywords such as const and r-value
overloads. Information about
noexcept , pure virtual ity
and delete d / default ed
functions is removed from the suffix and
available via other properties. |
func.deprecated |
Deprecation status 7 |
func.since |
Since which version the function is available 8 |
func.is_protected |
If the function is protected . Set
only for member functions. |
func.is_private |
If the function is private . Set only
for member functions. |
func.is_explicit |
If the function is explicit . Set
only for member functions. |
func.is_virtual |
If the function is virtual (or pure
virtual). Set only for member functions. |
func.is_pure_virtual |
If the function is pure virtual . Set
only for member functions. |
func.is_override |
If the function is an override . Set
only for member functions. |
func.is_final |
If the function is a final override .
Set only for member functions. |
func.is_noexcept |
If the function is noexcept (even
conditionally) |
func.is_conditional_noexcept |
If the function is conditionally
noexcept . |
func.is_constexpr |
If the function is constexpr |
func.is_consteval |
If the function is consteval |
func.is_defaulted |
If the function is default ed |
func.is_deleted |
If the function is delete d |
func.is_signal |
If the function is a Qt signal. Set only for member functions. |
func.is_slot |
If the function is a Qt slot. Set only for member functions. |
The func.params
is a list of function parameters and their description.
Each item has the following properties:
Property | Description |
---|---|
param.name |
Parameter name (if not anonymous) |
param.type |
Parameter type, together with array specification 6 |
param.type_name |
Parameter type, together with name and array specification 6 |
param.default |
Default parameter value, if any 6 |
param.description |
Optional parameter description. If set,
func.has_param_details is set as well. |
param.direction |
Parameter direction. One of 'in' , 'out' ,
'inout' or '' if unspecified. |
The func.return_values
property is a list of return values and their
description (in contract to func.return_value
, which is just a single
description). Each item is a tuple of (value, description)
. Can be empty,
it can also happen that both func.return_value
and func.return_values
are resent. Similarly, the func.exceptions
property is a list of
(type, description)
tuples.
Variable properties
The compound.vars
, compound.public_vars
and
compound.protected_vars
properties contain a list of variables, where
every item has the following properties:
Property | Description |
---|---|
var.base_url |
Base URL of file containing detailed description 3 |
var.include |
Corresponding #include to get the
variable declaration. Present only for
variables inside modules or inside namespaces
that are spread over multiple files. See
Include properties for more information. |
var.id |
Identifier hash 3 |
var.type |
Variable type 6 |
var.name |
Variable name 4 |
var.templates |
Template specification for C++14 variable templates. See Template properties for details. |
var.has_template_details |
If template parameters have description |
var.brief |
Brief description. Can be empty. 1 |
var.description |
Detailed description. Can be empty. 2 |
var.has_details |
If there is enough content for the full description block 5 |
var.deprecated |
Deprecation status 7 |
var.since |
Since which version the variable is available 8 |
var.is_static |
If the variable is static . Set only for
member variables. |
var.is_protected |
If the variable is protected . Set only
for member variables. |
var.is_constexpr |
If the variable is constexpr |
Define properties
The compound.defines
property contains a list of defines, where every
item has the following properties:
Property | Description |
---|---|
define.include |
Corresponding #include to get the
define definition. Present only for defines
inside modules, since otherwise the define is
documented inside a file docs and the
corresponding include is known implicitly. See
Include properties for more information. |
define.id |
Identifier hash 3 |
define.name |
Define name |
define.params |
List of macro parameter names. See below for details. |
define.has_param_details |
If define parameters have description |
define.return_value |
Return value description. Can be empty. |
define.brief |
Brief description. Can be empty. 1 |
define.description |
Detailed description. Can be empty. 2 |
define.deprecated |
Deprecation status 7 |
define.since |
Since which version the define is available 8 |
define.has_details |
If there is enough content for the full description block 5 |
The define.params
is set to None
if the macro is just a variable.
If it’s a function, each item is a tuple consisting of name and optional
description. If the description is set, define.has_param_details
is set
as well. You can use {% if define.params != None %}
to disambiguate
between preprocessor macros and variables in your code.
Type properties
For classes, the compound.public_types
and compound.protected_types
contains a list of (kind, type)
tuples, where kind
is one of
'class'
, 'enum'
or 'typedef'
and type
is a corresponding
type of object described above.
Template properties
The compound.templates
, typedef.templates
and func.templates
properties contain either None
if given symbol is a full template
specialization or a list of template parameters, where every item has the
following properties:
Property | Description |
---|---|
template.type |
Template parameter type (class ,
typename or a type) |
template.name |
Template parameter name |
template.default |
Template default value. Can be empty. |
template.description |
Optional template description. If set,
i.has_template_details is set as well. |
You can use {% if i.templates != None %}
to test for the field
presence in your code.
Group properties
The compound.groups
contains a list of user-defined groups. Each item has
the following properties:
Property | Description |
---|---|
group.id |
Group identifier 3 |
group.name |
Group name |
group.description |
Group description 2 |
group.members |
Group members. Each item is a tuple of
(kind, member) , where kind is one of
'namespace' , 'class' , 'enum' ,
'typedef' , 'func' , 'var' or
'define' and member is a corresponding type
of object described above. |