Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 87dbda0

Browse filesBrowse files
committed
feature #15102 [Workflow] Add info about MermaidDumper (eFrane)
This PR was merged into the 5.3-dev branch. Discussion ---------- [Workflow] Add info about MermaidDumper <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `5.x` for features of unreleased versions). --> This updates the documentation for symfony/symfony#40171. Commits ------- b7340c7 [Workflow] Add info about MermaidDumper
2 parents 4f0a1f0 + b7340c7 commit 87dbda0
Copy full SHA for 87dbda0

File tree

2 files changed

+19
-1
lines changed
Filter options

2 files changed

+19
-1
lines changed
23.6 KB
Loading

‎workflow/dumping-workflows.rst

Copy file name to clipboardExpand all lines: workflow/dumping-workflows.rst
+19-1Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@ them as SVG or PNG images. First, install any of these free and open source
99
applications 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+
1419
If you are defining the workflow inside a Symfony application, run this command
1520
to 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+
3547
The 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+
7996
Below 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

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.