@@ -9,8 +9,13 @@ them as SVG or PNG images. First, install any of these free and open source
99applications needed to generate the images:
1010
1111* `Graphviz `_, provides the ``dot `` command;
12+ * `Mermaid CLI `_, provides the ``mmdc `` command;
1213* `PlantUML `_, provides the ``plantuml.jar `` file (which requires Java).
1314
15+ .. versionadded :: 5.3
16+
17+ The ``mermaid `` dump format was introduced in Symfony 5.3.
18+
1419If you are defining the workflow inside a Symfony application, run this command
1520to dump it as an image:
1621
@@ -28,10 +33,17 @@ to dump it as an image:
2833 # highlight 'place1' and 'place2' in the dumped workflow
2934 $ php bin/console workflow:dump workflow-name place1 place2 | dot -Tsvg -o graph.svg
3035
36+ # using Mermaid.js CLI
37+ $ php bin/console workflow:dump workflow_name --dump-format=mermaid | mmdc -o graph.svg
38+
3139 The DOT image will look like this:
3240
3341.. image :: /_images/components/workflow/blogpost.png
3442
43+ The Mermaid image will look like this:
44+
45+ .. image :: /_images/components/workflow/blogpost_mermaid.png
46+
3547The PlantUML image will look like this:
3648
3749.. image :: /_images/components/workflow/blogpost_puml.png
@@ -63,7 +75,7 @@ You can use ``metadata`` with the following keys to style the workflow:
6375
6476 * ``bg_color ``: a color;
6577 * ``description ``: a string that describes the state.
66-
78+
6779* for transitions:
6880
6981 * ``label ``: a string that replaces the name of the transition;
@@ -76,6 +88,11 @@ Colors can be defined as:
7688* a color name from `PlantUML's color list `_;
7789* an hexadecimal color (both ``#AABBCC `` and ``#ABC `` formats are supported).
7890
91+ .. note ::
92+
93+ The Mermaid dumper does not support coloring the arrow heads
94+ with ``arrow_color `` as there is no support in Mermaid for doing so.
95+
7996Below is the configuration for the pull request state machine with styling added.
8097
8198.. configuration-block ::
@@ -310,5 +327,6 @@ The PlantUML image will look like this:
310327.. image :: /_images/components/workflow/pull_request_puml_styled.png
311328
312329.. _`Graphviz` : https://www.graphviz.org
330+ .. _`Mermaid CLI` : https://github.com/mermaid-js/mermaid-cli
313331.. _`PlantUML` : https://plantuml.com/
314332.. _`PlantUML's color list` : https://plantuml.com/color
0 commit comments