export a complex Markdown file into a standalone HTML file.
Project description
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][Dot language]
Markdown-TOC to create Table of Content
markdown-checklist [markdown-checklist] to support create Checklists
Instalation
Old School
you can install it with clone this repo:
git clone https://github.com/madeindjs/super-markdown.git cd super-markdown python setup.py install
New School
Or you can install it with pip:
pip install supermarkdown
Usage
Command line usage
to export one markdown file in one Html file:
super-markdown -f README.md
to export many markdown file in one Html file:
super-markdown -d /home/alex/markdown_files/
API usage
Hello World
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()
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()
Convert markdown file(s)
one file
supermd = SuperMarkdown() supermd.add_content('/home/alex/markdown_files/a_file.md') supermd.export()
many files
files = os.listdir('/home/alex/markdown_files/') supermd = SuperMarkdown() supermd.add_content(*files) supermd.export()
Syntax
Table of content
To create a [Table of content][TOC] you just need to insert [TOC] in your markdown file
Markdown
Mermaid.js
Dot Language
Requirements
First you need to download graphviz & install on your computer
Then you need to install these python libraries
You can do it quickly with this command pip install -r requirements.txt