|
1
|
# Workflows Diagram Generator |
|
2
|
|
|
3
|
An internal tool to generate [Mermaid](https://mermaid.js.org/) diagrams for workflows. |
|
4
|
|
|
5
|
> Note: This tool is a beta tool created to generate diagrams that can be used in the Medusa documentation. |
|
6
|
|
|
7
|
## Usage |
|
8
|
|
|
9
|
After installing the dependencies, run the following command: |
|
10
|
|
|
11
|
```bash |
|
12
|
yarn start run ./path/to/workflow -o ./path/to/output/dir |
|
13
|
``` |
|
14
|
|
|
15
|
Where: |
|
16
|
|
|
17
|
- `./path/to/workflow` is the path to a file containing a Workflow, or a directory containing more than one file. |
|
18
|
- `./path/to/output/dir` is the path to the directory that outputted diagrams should be placed in. |
|
19
|
|
|
20
|
### Command Options |
|
21
|
|
|
22
|
#### --t, --type |
|
23
|
|
|
24
|
```bash |
|
25
|
yarn start run ./path/to/workflow -o ./path/to/output/dir -t markdown |
|
26
|
``` |
|
27
|
|
|
28
|
The `type` of diagram to be generated. It can be one of the following: |
|
29
|
|
|
30
|
- `docs` (default): For each workflow, it creates a directory holding the diagram of the workflow and its code in separate files. Diagrams are placed in `.mermaid` files. |
|
31
|
- `markdown`: Generates the diagram of each workflow in a `.md` file. |
|
32
|
- `mermaid`: Generates the diagram of each workflow in a `.mermaid` file. |
|
33
|
- `console`: Outputs the diagrams in the console. |
|
34
|
- `svg`: Generates the diagram in SVG format. |
|
35
|
- `png`: Generates the diagram in PNG format. |
|
36
|
- `pdf`: Generates the diagram in PDF format. |
|
37
|
|
|
38
|
#### --no-theme |
|
39
|
|
|
40
|
```bash |
|
41
|
yarn start run ./path/to/workflow -o ./path/to/output/dir --no-theme |
|
42
|
``` |
|
43
|
|
|
44
|
Removes Medusa's default theming from the outputted diagram. Note that Medusa's theme doesn't support dark mode. |
|
45
|
|
|
46
|
#### --pretty-names |
|
47
|
|
|
48
|
```bash |
|
49
|
yarn start run ./path/to/workflow -o ./path/to/output/dir --pretty-names |
|
50
|
``` |
|
51
|
|
|
52
|
Changes slug and camel-case names of steps to capitalized names. |