Skip to content

Commit

Permalink
Initial modifications to plugin
Browse files Browse the repository at this point in the history
  - Compatibility with python3 (return str instead of unicode)
  - Update and complete the README.md
  • Loading branch information
Laurent Franceschetti committed Apr 15, 2020
1 parent abf1439 commit bb41868
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 18 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 PuGong
Copyright (c) 2018 PuGong -- 2020, others

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
51 changes: 42 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,66 @@
# mkdocs-markdownextradata-plugin

A MkDocs plugin that render meraid graph to mermaid style
A MkDocs plugin that renders mermaid graph to mermaid style.

> This is a fork from Pugong Liu's excellent project,
> which is no longer maintained."
## Installation

## Installation

### Automatic
Install the package with pip:

```bash
pip install mkdocs-mermaid-plugin
pip install mkdocs-mermaid-plugin2
```

## Usage
### Manual
Clone this repository:

```bash
python setup.py install
```

Enable this plugin in your `mkdocs.yml`:
## Installation

To enable this plugin, you need to declare it in your config file
(`mkdocs.yml`).

In order to work, the plugin also requires the
[mermaid](https://www.npmjs.com/package/mermaid) javascript
library (in the exemple below, it fetched from the last version
from the [unpkg](https://unpkg.com/) repository; change the version
no as needed).

```yaml
plugins:
- markdownmermaid
- markdownmermaid2

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

More information about plugins in the [MkDocs documentation][mkdocs-plugins]

## Usage

### General Principle
In order to insert a mermaid diagram, simply insert the diagram,
preceded by the language:


```mermaid
graph TD
A[Client] --> B[Load Balancer]
B --> C[Server01]
B --> D[Server02]
```

[mkdocs-plugins]: http://www.mkdocs.org/user-guide/plugins/
### How to write Mermaid diagrams
* For instructions on how to make a diagram, see
[the official website](https://mermaid-js.github.io/mermaid/#/).
* If you are not familiar, see the [n00bs' introduction to mermaid](https://mermaid-js.github.io/mermaid/#/n00b-overview).
* In case of doubt, you will want to test your diagrams in the
[Mermaid Live Editor](https://mermaid-js.github.io/mermaid-live-editor).
20 changes: 12 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,29 @@
from setuptools import setup, find_packages


VERSION = '0.1.2'

def readme():
"""print long description"""
with open('README.md') as f:
return f.read()

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

setup(
name='mkdocs-mermaid-plugin',
version='0.1.1',
description='A MkDocs plugin that support mermaid graph in markdown file',
name='mkdocs-mermaid-plugin2',
version=VERSION,
description='A MkDocs plugin for including mermaid graphs in markdown sources',
long_description=long_description,
keywords='mkdocs python markdown mermaid',
url='https://github.com/pugong/mkdocs-mermaid-plugin',
author='pugong',
author_email='pugong.liu@gmail.com',
author='pugong, Fralau',
author_email='pugong.liu@gmail.com, fralau2035@yahoo.com',
license='MIT',
python_requires='>=2.7',
install_requires=[
Expand All @@ -43,7 +47,7 @@ def readme():
packages=find_packages(exclude=['*.tests']),
entry_points={
'mkdocs.plugins': [
'markdownmermaid = markdownmermaid.plugin:MarkdownMermaidPlugin'
'markdownmermaid2 = markdownmermaid.plugin:MarkdownMermaidPlugin'
]
}
)

0 comments on commit bb41868

Please sign in to comment.