frostming / marko

A markdown parser with high extensibility.
https://marko-py.readthedocs.io/en/latest/
MIT License
345 stars 38 forks source link

Converting MD to HTML programmatically #163

Closed dsoprea closed 1 year ago

dsoprea commented 1 year ago

We can easily convert via the command-line, but it's not at all clear, to me, how to do this programmatically. Even the former appears to be a undocumented functionality:

$ cat /tmp/test.md | python -m marko 
<h2>Heading 1</h2>
<ul>
<li>Bullet1</li>
<li>Bullet2</li>
<li>Bullet3</li>
</ul>

Can you provide some guidance?

Thank you.

frostming commented 1 year ago

Isn't it documented at https://marko-py.readthedocs.io/en/latest/ ?

dsoprea commented 1 year ago

Yes. I got my wires across. I need to ultimately produce PDF and for some reason I was looking at HTML and thinking "PDF", and then not able to find any references within the Marko sourcecode. Even the title said "PDF", not "HTML". My bad.