Try something like this:
>>> from docutils.core import publish_string
>>> publish_string("*anurag*", writer_name='html')
publish_string
accepts a strings and outputs a string or you can use publish_parts to get specific parts of html document e.g.
>>> from docutils.core import publish_parts
>>> print publish_parts("*anurag*", writer_name='html')['html_body']
<p><em>anurag</em></p>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With