a Python library to export a complex Markdown file into a standalone HTML file.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
SuperMarkdown
.gitignore
LICENSE.txt
MANIFEST.in
README.md
__main__.py
requirements.txt
setup.py

README.md

Super-Markdown

a Python library to export a complex Markdown file into a standalone HTML file.

It will include:

Instalation

Old School

git clone https://github.com/madeindjs/super-markdown.git
cd super-markdown
python setup.py install

New School

pip install supermarkdown

Usage

Command line usage

  • 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/

additional options

  • 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

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()
# 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()

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 you just need to insert [TOC] in your markdown file

Markdown

Markdown-Cheatsheet

Mermaid.js

Mermaid.js Basic Syntax

Dot Language

Dot Language Cheatsheet

Requirements

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

Author

Rousseau Alexandre

Contributors

License

MIT