HTML
The html generator is the default. It produces a tree of HTML pages backed by a bundled stylesheet, ready to be served as-is from any static-file host. Pick it explicitly through the generator option:
generator: html
Output layout
In the default multipage mode, every symbol gets its own page under the output directory, mirroring its parent-context tree (the namespace, class, or class template each symbol is declared inside). The top-level index.html is the page for the global namespace; set global-namespace-index to true to make that page also serve as a project-wide table of contents.
output/
index.html
logr/
log/
scoped_context.html
...
Set multipage: false to fold every symbol into a single HTML file. The file is written to whatever path the output option points at (the option is interpreted as a file path rather than a directory in that mode), and per-symbol URLs go away.
For embedding inside an outer document, set embedded to true; it strips the surrounding <html>/<head>/<body> wrapper and emits just the symbol-level markup. The Mr.Docs website uses this on its landing page: the panels that show what a rendered symbol looks like are produced by running Mr.Docs with embedded: true and dropping the resulting fragment into the page next to the source it documents.
Stylesheet options
The HTML output ships with a bundled CSS file inlined into each page. You can replace or layer styles through the following options:
stylesheets-
Ordered list of stylesheet paths or URLs. If empty, the bundled CSS is used. Remote URLs require
linkcss: true. no-default-styles-
Skip the bundled CSS entirely.
linkcss-
Emit
<link>tags instead of inline<style>blocks. Local styles are copied alongside the output by default; remote URLs are linked rather than copied. copycss-
When linking, copy bundled and local styles into the output tree (default
true). Set tofalseto skip copying. stylesdir-
Directory (relative to the output root) used for linked styles.
stylesdir: cssresults incss/custom.cssandcss/site.css.
generator: html
stylesheets:
- custom.css
linkcss: true
stylesdir: css
The same options can be passed on the command line. LLVM’s command-line parser expects --name=value for options that take a value, and a bare --name (or --name=true / --name=false) for boolean switches:
mrdocs --generator=html --stylesheets=custom.css --linkcss --stylesdir=css
Customizing the markup
The page structure itself is rendered from Handlebars templates under <mrdocs-root>/share/mrdocs/addons/generator/html/. Layer overrides on top with the addons-supplemental option to change a single partial without copying the whole tree. The data your overrides see is documented in the DOM reference.