Skip to content

Commit 9085046

Browse files
committed
doc: document new mermaid/html-macro support
Signed-off-by: James Knight <[email protected]>
1 parent 0407932 commit 9085046

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

doc/configuration.rst

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2174,6 +2174,54 @@ Advanced processing configuration
21742174
- |confluence_disable_autogen_title|_
21752175
- |confluence_title_overrides|_
21762176

2177+
Third-party related options
2178+
---------------------------
2179+
2180+
.. note::
2181+
2182+
The configurations in this section are specific to supporting
2183+
:ref:`third-party extensions <extensions_third_party>`; results may
2184+
vary.
2185+
2186+
.. confval:: confluence_mermaid_html_macro
2187+
2188+
.. versionadded:: 2.7
2189+
2190+
.. warning::
2191+
2192+
This option relies on an HTML macro which is not available in a
2193+
default Confluence configuration. Using this option is only useful
2194+
for users that have instances where a system administrator has
2195+
enabled their use.
2196+
2197+
.. note::
2198+
2199+
This option will most likely require additional configuration to
2200+
function. Setting this option only produces HTML macros with Mermaid
2201+
content but does not automatically include the JavaScript required to
2202+
process this content.
2203+
2204+
There can be various ways an instance/page can be configured to
2205+
include Mermaid JS support. For example, adding the following content
2206+
on the page planning to render diagrams:
2207+
2208+
.. code-block:: rst
2209+
2210+
.. confluence_html::
2211+
2212+
<script type="module">
2213+
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
2214+
</script>
2215+
2216+
When using the `sphinxcontrib-mermaid`_ extension, this option can be
2217+
used pass raw Mermaid figures into an HTML macro.
2218+
2219+
.. code-block:: python
2220+
2221+
confluence_mermaid_html_macro = True
2222+
2223+
See also |confluence_html_macro|_.
2224+
21772225
Other options
21782226
-------------
21792227

@@ -2281,6 +2329,7 @@ Deprecated options
22812329
.. _root_doc: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-root_doc
22822330
.. _sphinx-build: https://www.sphinx-doc.org/en/master/man/sphinx-build.html
22832331
.. _sphinx.ext.imgmath: https://www.sphinx-doc.org/en/master/usage/extensions/math.html#module-sphinx.ext.imgmath
2332+
.. _sphinxcontrib-mermaid: https://pypi.org/project/sphinxcontrib-mermaid/
22842333
.. _suppress_warnings: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-suppress_warnings
22852334
.. _toctree: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-toctree
22862335
.. _write_doc: https://www.sphinx-doc.org/en/master/extdev/builderapi.html#sphinx.builders.Builder.write_doc

doc/features.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ Type Notes
194194

195195
\newpage
196196

197+
.. _extensions_third_party:
198+
197199
Extensions (Third-party)
198200
------------------------
199201

@@ -277,7 +279,9 @@ Type Notes
277279
`sphinxcontrib-kroki`_ Supported
278280
`sphinxcontrib-mermaid`_ Limited support.
279281

280-
Requires a PNG/SVG configuration.
282+
Requires a PNG/SVG configuration. Raw/HTML
283+
renders can be used for environments with
284+
HTML macro support.
281285
`sphinxcontrib-nwdiag`_ Limited support.
282286

283287
PNGs only; cannot configure for SVG at this

0 commit comments

Comments
 (0)