[elbe-devel] [PATCH v2 3/9] docs: sphinx: generate diagrams via graphviz

Thomas Weißschuh thomas.weissschuh at linutronix.de
Tue Apr 9 13:11:32 CEST 2024


Over plain images these have the advantage that they can be vector
graphics and get generated by sphinx directly without an additional
buildstep.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 docs/article-elbeoverview-en.rst | 7 +++----
 docs/conf.py                     | 6 +++++-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/docs/article-elbeoverview-en.rst b/docs/article-elbeoverview-en.rst
index b7019202b175..70d957830250 100644
--- a/docs/article-elbeoverview-en.rst
+++ b/docs/article-elbeoverview-en.rst
@@ -97,15 +97,14 @@ happens:
 
 This diagram illustrates the complete process:
 
-.. figure:: elbe-process.png
-   :alt: elbe-process.png
+.. graphviz:: elbe-process.dot
+   :layout: neato
 
 The following figure shows the steps performed inside the build VM
 during the build process of the target. The highlighted steps are
 performed inside a chroot environment:
 
-.. figure:: elbeoverview-en__1.png
-   :alt: elbeoverview-en\__1.png
+.. graphviz:: emu-process.dot
 
 On regular Debian installations, init scripts installed by packages are
 started automatically during the post-installation step. Please note
diff --git a/docs/conf.py b/docs/conf.py
index a71aa7a5b904..0ff82f75bd79 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -35,7 +35,9 @@ subprocess.run(['make'], check=True)
 # Add any Sphinx extension module names here, as strings. They can be
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 # ones.
-extensions = []
+extensions = [
+    'sphinx.ext.graphviz',
+]
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
@@ -158,3 +160,5 @@ texinfo_documents = [
 ]
 
 html_sidebars = {'**': ['globaltoc.html']}
+
+graphviz_output_format = 'svg'

-- 
2.44.0



More information about the elbe-devel mailing list