Skip to main content

Write Markdown in Pythonic way

Project description

Python Markdown Maker

Python Objects for Markdown

Python Markdown maker use to write markdown documents in the Pythonic way

Installation

$ git clone https://github.com/yogeshwaran01/python-markdown-maker/
$ cd python-markdown-maker/
$ python3 setup.py install

Usage

Elements Normal Markdown Pythonic Markdown
Headings ## Python headers('Python', level=3)
Images ![alt](source) image(src, alt)
Links [text](link) links(link, text)
Bold **Bold** styled_text(text, bold=True)
Italic *Italic* styled_text(text, italic=True)
Striketrough ~~text~~ styled_text(text, strikethrough=True
Inline code some code inline_code("some code")
Blackquotes > text are super blockquotes('text are super')

Code Blocks

code_block("print('Hello World!')", lang='python')

UnOrdered List

lists(['Python', 'Javascript', 'Go', 'PhP'])
- Python
- Javascript
- Go
- PhP

Ordered List

lists(['order', 'Python', 'Javascript', 'Go', 'PhP'])
1. Python
2. Javascript
3. Go
4. PhP

Both Ordered & Unorder list

lists([
    'Frontend',[
        'order', 'Html', 'Css', 'Javascript'
    ],
    'Backend',[
        'order', 'Python', 'Postgress'
    ]
])
- Frontend 1. Html 2. Css 3. Javascript
- Backend 1. Python 2. Postgress

Tables

t = Table(["Languages", "Uses"])
t.add_item("Python", "ML/AI")
t.add_item("Javascript", "Web Dev")
table = t.render()
    Languages | Uses

--------- | ----
Python | ML/AI
Javascript | Web Dev

Rendering

from python_markdown_maker import *

ou = lists([
    'Frontend',[
        'order', 'Html', 'Css', 'Javascript'
    ],
    'Backend',[
        'order', 'Python', 'Postgress'
    ]
])

t = Table(["Languages", "Uses"])
t.add_item(["Python", "ML/AI"])
t.add_item(["Javascript", "Web Dev"])
table = t.render()

items = lists(['order', 'Python', 'Javascript', 'Go', 'PhP'])

md = Document()
md.write([ou, table, items])

with open('code.md', 'w') as file:
    md.render.save_as_md(file)
    # md.render.save_as_html(file)
    # md.render.to_html()
    # md.render.text

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-markdown-maker-1.0.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

python_markdown_maker-1.0-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page