@@ -12,6 +12,7 @@ sphinx = "*"
sphinx-rtd-theme = "*"
pyyaml = "*"
sphinx-copybutton = "*"
+sphinxcontrib-mermaid = "*"
# SVG to PNG only supported since 2.0.0
sphinxcontrib-svg2pdfconverter = ">=2.0.0"
@@ -50,10 +50,16 @@ extensions = [
'sphinx.ext.extlinks',
'sphinx.ext.intersphinx',
'sphinx_copybutton',
+ 'sphinxcontrib.mermaid',
'sphinxcontrib.rsvgconverter',
'yocto-vars'
]
+# Let Mermaid diagrams keep their natural aspect ratio (based on each
+# diagram's own width/height) instead of being squeezed into the default
+# fixed 500px height, which visibly distorted/shrank taller flowcharts.
+mermaid_height = "auto"
+
# current_version = "dev"
# bitbake_version = "" # Leave empty for development branch
# Obtain versions from poky.yaml instead
@@ -171,3 +171,20 @@ section#welcome-to-the-yocto-project-documentation p.caption {
}
}
+
+/*
+ * Mermaid diagrams are rendered inside a <pre class="mermaid"> element, so
+ * they otherwise inherit this theme's monospace "pre" font, and some of
+ * Mermaid's edge labels end up keeping their default 16px font size instead
+ * of the larger size configured in the diagrams themselves. Force a
+ * consistent, larger, non-monospace font so label text isn't clipped by a
+ * too-small measured bounding box.
+ */
+.mermaid,
+.mermaid .edgeLabel,
+.mermaid .edgeLabel p,
+.mermaid .nodeLabel,
+.mermaid .nodeLabel p {
+ font-family: Helvetica, Arial, sans-serif !important;
+ font-size: 20px !important;
+}