a Python library to export a complex Markdown file into a standalone HTML file.
It will include:
- Mermaid.js to create diagrams with javascript
- graphviz to create Diagrams in Dot language
- Markdown-TOC to create Table of Content
- markdown-checklist to support create Checklists
- Github Flavoured MarkdownStylesheet
git clone https://github.com/madeindjs/super-markdown.git
cd super-markdown
python setup.py install
pip install supermarkdown
- export one markdown file in one Html file
super-markdown -f README.md
- export many markdown files in one Html file
super-markdown -d /home/alex/markdown_files/
- Choose the name of the output file
super-markdown -d /home/alex/markdown_files/ -o my_concatenated_file.html
- Prevent the browser from opening
super-markdown -d /home/alex/markdown_files/ -no_browser
from SuperMarkdown import SuperMarkdown
supermd = SuperMarkdown()
content = "# Hello World\r\n"
content += "[SuperMarkdown](https://github.com/madeindjs/Super-Markdown) is awesome!"
supermd.add_content(text=content)
supermd.export()
# Additional options
supermd.export_url = 'my_export_url.html' # to change the export filename
supermd.open_browser = False # to deactivate browser opening
Add Table of Content
supermd.add_TOC(text=content)
content = "## Other title\r\n## Other title\r\n###sutitle\r\n## Other title"
supermd.add_content(text=content)
supermd.export()
Add Dot Graph
dotgraph = """```dotgraph
digraph "pet-shop" {
graph [rankdir=LR]
node [shape=plaintext]
edge [arrowhead=vee arrowsize=2]
parrot
dead
parrot -> dead
}
```"""
supermd.add_content(text=dotgraph)
supermd.export()
supermd = SuperMarkdown()
supermd.add_content('/home/alex/markdown_files/a_file.md')
supermd.export()
files = os.listdir('/home/alex/markdown_files/')
supermd = SuperMarkdown()
supermd.add_content(*files)
supermd.export()
To create a Table of content you just need to insert [TOC]
in your markdown file
First you need to install graphviz on your computer
Then you need to install these python librairy
You can do it quickly with this command pip install -r requirements.txt