Python tool to write Markdown easily.
Project description
MarkdownIO
Python tool to write Markdown easily.
Installation
$ pip install markdownio
Usage
from markdownio import MarkdownIO, block, span
markdown = MarkdownIO()
title = block.Header1("My test document")
markdown.add(title)
text_p1 = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus " \
"rutrum consequat " + span.bold("odio") + " et mollis."
p1 = block.Paragraph(text_p1)
markdown.add(p1)
img = block.Paragraph(span.image(path="path/img.jpg", alt="img", title="img"))
markdown.add(img)
table = block.Table(columns=3)
table.set_headers(['Col1', 'Col2', 'Col3'])
table.add_row(['foo', 'bar', 'foobar'])
table.add_row(['oof', 'rab', 2000])
markdown.add(table)
text_p2 = "This is an interesting article: " + span.link(path='http://test.io')
p2 = block.Paragraph(text_p2)
markdown.add(p2)
subtitle = block.Header2("Code example")
markdown.add(subtitle)
code = block.Code('<p>Test</p>', language='html')
markdown.add(code)
print(markdown.output())
output:
# My test document
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus rutrum consequat **odio** et mollis.
![img](path/img.jpg "img")
| Col1 | Col2 | Col3 |
| ---- | ---- | ------ |
| foo | bar | foobar |
| oof | rab | 2000 |
This is an interesting article: <http://test.io>
## Code example
```html
<p>Test</p>
\```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
markdownio-0.0.2.tar.gz
(5.4 kB
view hashes)
Built Distribution
Close
Hashes for markdownio-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0762df85322ff229a4d7fd5ec4b716b974909d95a90320aa6e1c2a909424225d |
|
MD5 | b8ddcf62f94b3f2ca46675289935f370 |
|
BLAKE2b-256 | 7268b740abb97aec6f191c3c79376fe64a6d17de9d9c92eda62b4ab37db3a98e |