Python Markdown Maker
Python Objects for Markdown
Python Markdown maker use to write markdown documents in the Pythonic wayInstallation
$ 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