Skip to content

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

License

Notifications You must be signed in to change notification settings

TiagoDanin-Forks/Super-Markdown

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 93.2%
  • HTML 5.0%
  • CSS 1.8%