MarkdownIO
Python tool to write Markdown as code easily.
Installation
$ pip install markdownio
Usage
from markdownio import MarkdownIO, span
from markdownio.block import TableHeader
markdown = MarkdownIO()
markdown.h1("My test document")
markdown.p(
text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. "
"Vivamus rutrum consequat " + span.bold("odio") + " et mollis."
)
markdown.p(span.image(path="path/img.jpg", alt="img", title="img"))
markdown.table(
columns=3,
headers=['Col1', 'Col2', TableHeader.center('Col3')],
rows=[
['foo', 'bar', 'foobar'],
['oof', 'rab', 2000],
]
)
markdown.p(
text="This is an interesting article: " + span.link(path='http://test.io')
)
markdown.h2("Code example")
markdown.code(text='<p>Test</p>', language='html')
print(markdown.output())
output:
# My test document
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus rutrum consequat **odio** et mollis. p

| Col1 | Col2 | Col3 |
| ---- | ---- | :----: |
| foo | bar | foobar |
| oof | rab | 2000 |
This is an interesting article: <http://test.io>
## Code example
```html
<p>Test</p>
```
Merge two documents
from markdownio import MarkdownIO
document1 = MarkdownIO()
document1.p("Part 1.")
document2 = MarkdownIO()
document2.p("Part 2.")
full_document = document1 + document2
print(full_document.output())
output:
Part 1.
Part 2.
Documentation
Metadata
Release files for markdownio 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| markdownio-0.1.0.tar.gz | 7.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| markdownio-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.0 kB
Release files / markdownio-0.1.0.tar.gz
| Download URL | markdownio-0.1.0.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cccb4029913433e95f06adda46927c7179a536d6f9588faf96e4ef01f43a0fbe
|
|
BLAKE2b-256 checksum How to use checksums |
5783e2263e8498a5c0b3f693fe52e049e65d084ad66823ddb112acc0fcd79aa6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.11 CPython/3.8.10 Linux/5.4.0-89-generic
|
Release files / markdownio-0.1.0-py3-none-any.whl
| Download URL | markdownio-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3d60f35d32c34c0740b66935c65cf644e5ef64a5c243e907cb1ec7c5cb1f23cb
|
|
BLAKE2b-256 checksum How to use checksums |
3a791e7e0ad9f2f30ec93e2290dece6f3e8c442505639f0986bf37b59fbb4484
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.11 CPython/3.8.10 Linux/5.4.0-89-generic
|