Skip to content

Commit

Permalink
doc: update readme with short syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
u8slvn committed Oct 30, 2021
1 parent cb42fc6 commit 0dde7ca
Showing 1 changed file with 20 additions and 27 deletions.
47 changes: 20 additions & 27 deletions README.md
Expand Up @@ -17,37 +17,30 @@ $ pip install markdownio
## Usage

```python
from markdownio import MarkdownIO, block, span
from markdownio import MarkdownIO, 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)
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', '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())
```
Expand Down

0 comments on commit 0dde7ca

Please sign in to comment.