Skip to content

Commit

Permalink
docs: generator DOM reference
Browse files Browse the repository at this point in the history
  • Loading branch information
alandefreitas committed Nov 6, 2024
1 parent 4393f22 commit a5d78ac
Show file tree
Hide file tree
Showing 4 changed files with 859 additions and 54 deletions.
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* xref:usage.adoc[Getting Started]
* xref:commands.adoc[Documenting the Code]
* xref:config-file.adoc[]
* xref:generators.adoc[]
* xref:design-notes.adoc[]
* xref:contribute.adoc[]
* xref:license.adoc[]
57 changes: 3 additions & 54 deletions docs/modules/ROOT/pages/config-file.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ include::partial$mrdocs-example.yml[]
--------

The xref:usage.adoc[Usage] page provides a detailed explanation of what to combine options from the configuration file and the command line.

The <<config-options-reference>> section provides a detailed explanation of the options available.

More information about the generators can be found in the xref:generators.adoc[Generators] page.

== YAML Schema

To get linting and autocompletion in the config file, a schema for the config can be specified.
Expand Down Expand Up @@ -44,60 +47,6 @@ When this file is generated from a `CMakeLists.txt` script, the `cmake` option c
Additionally, the `defines` option can be used to specify preprocessor definitions that should be used when generating the documentation.
These definitions are included in all targets of the compilation database.

== Generators

MrDocs supports multiple output formats that can be specified via the `generate` option:

|===
|Format |Description

|`adoc`
|AsciiDoc format.

|`html`
|HTML format.

|`xml`
|XML format.
|===

* Asciidoc is a text-based format that is easy to read and write.
It can also be converted to other formats such as HTML and Markdown.

* HTML can be generated directly with the `html` format.

* XML is a structured format that can be used in tests or as an intermediary format for other tools.

The `generate` option can be used to specify the output format:

[source,yaml]
----
# ...
generate: adoc
# ...
----

=== Generator Templates

MrDocs attempts to support various alternatives for customizing the output format and style without complex workflows to post-process XML output.
For the Asciidoc and HTML generators, the desired customization can usually be achieved by modifying the templates used to generate the output.

In the root of the installation directory, you will find the `share/mrdocs/addons/generator` directory.
This directory contains the templates used to generate the documentation with the markup formats.
Users can create a copy of these files and provide their own `addons` directory via the `addons` option.
This allows users to customize the output format to their needs.

[source,yaml]
----
addons: /path/to/custom/addons
----

One advantage of custom templates over post-processing XML files is the ability to access symbols as a graph.
If symbol `A` refers to symbol `B`, some properties of symbol `B` are likely to be required in the documentation of `A`.
All templates and generators can access a reference to `B` by searching the symbol tree or simply by accessing the elements `A` refers to.

// === Generator Plugins

== Filters

=== Symbol Filters
Expand Down
Loading

0 comments on commit a5d78ac

Please sign in to comment.