Skip to content

Commit bb41868

Browse files
author
Laurent Franceschetti
committed
Initial modifications to plugin
- Compatibility with python3 (return str instead of unicode) - Update and complete the README.md
1 parent abf1439 commit bb41868

3 files changed

Lines changed: 55 additions & 18 deletions

File tree

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 PuGong
3+
Copyright (c) 2018 PuGong -- 2020, others
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,66 @@
11
# mkdocs-markdownextradata-plugin
22

3-
A MkDocs plugin that render meraid graph to mermaid style
3+
A MkDocs plugin that renders mermaid graph to mermaid style.
44

5+
> This is a fork from Pugong Liu's excellent project,
6+
> which is no longer maintained."
57
6-
## Installation
78

9+
## Installation
810

11+
### Automatic
912
Install the package with pip:
1013

1114
```bash
12-
pip install mkdocs-mermaid-plugin
15+
pip install mkdocs-mermaid-plugin2
1316
```
1417

15-
## Usage
18+
### Manual
19+
Clone this repository:
20+
21+
```bash
22+
python setup.py install
23+
```
1624

17-
Enable this plugin in your `mkdocs.yml`:
25+
## Installation
26+
27+
To enable this plugin, you need to declare it in your config file
28+
(`mkdocs.yml`).
29+
30+
In order to work, the plugin also requires the
31+
[mermaid](https://www.npmjs.com/package/mermaid) javascript
32+
library (in the exemple below, it fetched from the last version
33+
from the [unpkg](https://unpkg.com/) repository; change the version
34+
no as needed).
1835

1936
```yaml
2037
plugins:
21-
- markdownmermaid
38+
- markdownmermaid2
2239

2340
extra_javascript:
24-
- https://unpkg.com/mermaid@7.1.2/dist/mermaid.min.js
41+
- https://unpkg.com/mermaid@8.5.0/dist/mermaid.min.js
2542
```
2643
2744
> **Note:** Don't forget to include the mermaid.min.js (local or remotely) in your `mkdocs.yml`
2845

29-
More information about plugins in the [MkDocs documentation][mkdocs-plugins]
46+
47+
## Usage
48+
49+
### General Principle
50+
In order to insert a mermaid diagram, simply insert the diagram,
51+
preceded by the language:
3052

3153

54+
```mermaid
55+
graph TD
56+
A[Client] --> B[Load Balancer]
57+
B --> C[Server01]
58+
B --> D[Server02]
59+
```
3260

33-
[mkdocs-plugins]: http://www.mkdocs.org/user-guide/plugins/
61+
### How to write Mermaid diagrams
62+
* For instructions on how to make a diagram, see
63+
[the official website](https://mermaid-js.github.io/mermaid/#/).
64+
* If you are not familiar, see the [n00bs' introduction to mermaid](https://mermaid-js.github.io/mermaid/#/n00b-overview).
65+
* In case of doubt, you will want to test your diagrams in the
66+
[Mermaid Live Editor](https://mermaid-js.github.io/mermaid-live-editor).

setup.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,29 @@
22
from setuptools import setup, find_packages
33

44

5+
VERSION = '0.1.2'
6+
57
def readme():
68
"""print long description"""
79
with open('README.md') as f:
810
return f.read()
911

1012
long_description = (
11-
"This is a mkdocs plugin that could enable the mermaid graph in the markdown file."
12-
"Please follow the instruction in reame to enable this plugin"
13+
"A mkdocs plugin that interprets mermaid graphs in the markdown file."
14+
"To install, please follow instructions in the readme file."
15+
"This is a fork of the Pugong Liu's excellent project, "
16+
"which is no longer maintained."
1317
)
1418

1519
setup(
16-
name='mkdocs-mermaid-plugin',
17-
version='0.1.1',
18-
description='A MkDocs plugin that support mermaid graph in markdown file',
20+
name='mkdocs-mermaid-plugin2',
21+
version=VERSION,
22+
description='A MkDocs plugin for including mermaid graphs in markdown sources',
1923
long_description=long_description,
2024
keywords='mkdocs python markdown mermaid',
2125
url='https://github.com/pugong/mkdocs-mermaid-plugin',
22-
author='pugong',
23-
author_email='pugong.liu@gmail.com',
26+
author='pugong, Fralau',
27+
author_email='pugong.liu@gmail.com, fralau2035@yahoo.com',
2428
license='MIT',
2529
python_requires='>=2.7',
2630
install_requires=[
@@ -43,7 +47,7 @@ def readme():
4347
packages=find_packages(exclude=['*.tests']),
4448
entry_points={
4549
'mkdocs.plugins': [
46-
'markdownmermaid = markdownmermaid.plugin:MarkdownMermaidPlugin'
50+
'markdownmermaid2 = markdownmermaid.plugin:MarkdownMermaidPlugin'
4751
]
4852
}
4953
)

0 commit comments

Comments
 (0)