Skip to content

Commit cca0de6

Browse files
committed
GH-11: Document the theme usage with examples
1 parent f755fa7 commit cca0de6

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,36 @@ Once you have installed the app, you can use the `mermaid` template tag in your
3333
{% mermaid "graph LR; A-->B;" %}
3434
```
3535

36+
### Mermaid version
37+
3638
By default, Django Mermaid uses the **9.4.3** version of mermaid. However, if you want to use a specific version of
37-
mermaid, you can set the `MERMAID_VERSION` variable in your Django project's settings.py file.
39+
mermaid, you can set the `MERMAID_VERSION` variable in your Django project's **settings.py** file.
3840

3941
```python
4042
MERMAID_VERSION = '10.0.3-alpha.1'
4143
```
4244

4345
Make sure the version you specify is available on the [mermaid CDN](https://cdnjs.com/libraries/mermaid), and has
44-
the `mermaid.min.js` file.
46+
the **mermaid.min.js** file.
47+
48+
### Mermaid theme
49+
50+
You can specify the theme right in the template tag dynamically overriding the value of the `MERMAID_THEME` variable.
51+
52+
```jinja2
53+
{% mermaid "graph LR; A-->B;" "dark" %}
54+
```
55+
56+
Also, you can set the `MERMAID_THEME` variable in your Django project's **settings.py** file as a default theme.
57+
However, Django Mermaid uses the
58+
[default](https://github.com/mermaid-js/mermaid/blob/develop/packages/mermaid/src/themes/theme-default.js) theme of
59+
mermaid by default.
60+
61+
```python
62+
MERMAID_THEME = 'neutral'
63+
```
64+
65+
The available themes supported by mermaid are listed at mermaid [docs](https://mermaid.js.org/config/theming).
4566

4667
## Contribute
4768

0 commit comments

Comments
 (0)