Skip to content

Commit 8d118ad

Browse files
Copilotcodingjoe
andcommitted
Update documentation to reference Mermaid instead of Graphviz
Co-authored-by: codingjoe <[email protected]>
1 parent 0dea1ba commit 8d118ad

File tree

6 files changed

+41
-43
lines changed

6 files changed

+41
-43
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- uses: actions/setup-python@v6
3636
with:
3737
python-version: "3.x"
38-
- run: sudo apt install -y python3-enchant graphviz
38+
- run: sudo apt install -y python3-enchant
3939
- run: python -m pip install sphinxcontrib-spelling
4040
- run: python -m pip install -e '.[docs]'
4141
- run: python -m sphinx -W -b spelling docs docs/_build
@@ -83,7 +83,7 @@ jobs:
8383
- uses: actions/setup-python@v6
8484
with:
8585
python-version: ${{ matrix.python-version }}
86-
- run: sudo apt install -y graphviz redis-server
86+
- run: sudo apt install -y redis-server
8787
- run: python -m pip install "django==${{ matrix.django-version }}.*"
8888
- run: python -m pip install -e .[${{ matrix.extras }}]
8989
- run: python -m pytest

.readthedocs.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ build:
88
os: ubuntu-20.04
99
tools:
1010
python: "3.11"
11-
apt_packages:
12-
- graphviz
1311

1412
sphinx:
1513
configuration: docs/conf.py

docs/commands.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,19 @@ render_workflow_graph
99

1010
Render workflow graph to file::
1111

12-
usage: manage.py render_workflow_graph [-h] [-f {svg,pdf,png}] [-d DIRECTORY]
13-
[-c] [model [model ...]]
12+
usage: manage.py render_workflow_graph [-h] [-f {mmd,mermaid}] [-d DIRECTORY]
13+
[workflow [workflow ...]]
1414

15-
Render workflow graph to file.
15+
Render workflow graph to file in Mermaid format.
1616

1717
positional arguments:
1818
workflow List of workflow to render in the form
1919
app_label.workflow_name
2020

2121
optional arguments:
2222
-h, --help show this help message and exit
23-
-f {svg,pdf,png}, --format {svg,pdf,png}
24-
Output file format. Default: svg
23+
-f {mmd,mermaid}, --format {mmd,mermaid}
24+
Output file format. Default: mmd (Mermaid markdown)
2525
-d DIRECTORY, --directory DIRECTORY
2626
Output directory. Default is current working
2727
directory.
28-
-c, --cleanup Remove dot-files after rendering.

docs/conf.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,11 @@ def linkcode_resolve(domain, info):
7171
),
7272
"dramatiq": ("https://dramatiq.io/", None),
7373
"celery": ("https://docs.celeryproject.org/en/stable/", None),
74-
"graphviz": ("https://graphviz.readthedocs.io/en/stable/", None),
7574
}
7675

7776
spelling_word_list_filename = "spelling_wordlist.txt"
7877
spelling_show_suggestions = True
7978

80-
graphviz_output_format = "svg"
81-
8279
inheritance_graph_attrs = dict(
8380
rankdir="TB", size='"6.0, 8.0"', fontsize=14, ratio="compress"
8481
)

docs/index.rst

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,25 @@ Django_ web framework.
1717
Here is a little sample of what a workflow or process written with joeflow
1818
may look like:
1919

20-
.. graphviz::
21-
22-
digraph {
23-
graph [rankdir=LR]
24-
node [fillcolor=white fontname="sans-serif" shape=rect style=filled]
25-
checkout [color=black fontcolor=black style="filled, rounded"]
26-
"has email" [color=black fontcolor=black style=filled]
27-
ship [color=black fontcolor=black style="filled, rounded"]
28-
end [color=black fontcolor=black style=filled peripheries=2]
29-
"send tracking code" [color=black fontcolor=black style=filled]
30-
checkout -> ship
31-
ship -> "has email"
32-
"has email" -> "send tracking code"
33-
"has email" -> end [color="#888888"]
34-
"send tracking code" -> end
35-
}
20+
.. code-block:: mermaid
21+
22+
graph LR
23+
checkout(checkout)
24+
has_email[has email]
25+
ship(ship)
26+
end[end]
27+
send_tracking_code[send tracking code]
28+
checkout --> ship
29+
ship --> has_email
30+
has_email --> send_tracking_code
31+
has_email --> end
32+
send_tracking_code --> end
33+
style checkout fill:white,stroke:#000,stroke-width:2px,color:#000
34+
style has_email fill:white,stroke:#000,stroke-width:2px,color:#000
35+
style ship fill:white,stroke:#000,stroke-width:2px,color:#000
36+
style end fill:white,stroke:#000,stroke-width:4px,color:#000
37+
style send_tracking_code fill:white,stroke:#000,stroke-width:2px,color:#000
38+
linkStyle 3 stroke:#888888
3639
3740
.. code-block:: python
3841

docs/tutorial/workflow.rst

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,21 @@ user. A human selects the user (or leaves the field blank). If the user is set
88
a welcome emails is being sent. If the user is blank no email will be send and
99
the workflow will end right way.
1010

11-
.. graphviz::
12-
13-
digraph {
14-
graph [rankdir=LR]
15-
node [fillcolor=white fontname="Georgia, serif" shape=rect style=filled]
16-
start [color=black fontcolor=black style="filled, rounded"]
17-
"send welcome email" [color=black fontcolor=black style=filled]
18-
end [color=black fontcolor=black style=filled]
19-
"has user" [color=black fontcolor=black style=filled]
20-
start -> "has user"
21-
"has user" -> end
22-
"has user" -> "send welcome email"
23-
"send welcome email" -> end
24-
}
11+
.. code-block:: mermaid
12+
13+
graph LR
14+
start(start)
15+
send_welcome_email[send welcome email]
16+
end[end]
17+
has_user[has user]
18+
start --> has_user
19+
has_user --> end
20+
has_user --> send_welcome_email
21+
send_welcome_email --> end
22+
style start fill:white,stroke:#000,stroke-width:2px,color:#000
23+
style send_welcome_email fill:white,stroke:#000,stroke-width:2px,color:#000
24+
style end fill:white,stroke:#000,stroke-width:2px,color:#000
25+
style has_user fill:white,stroke:#000,stroke-width:2px,color:#000
2526
2627
Let's start with the data structure or workflow state. We need a model that can
2728
store a user. Like so:

0 commit comments

Comments
 (0)