Repo is currently a work in progress. Not ready to be used.
HTML renderer for Sanity's Portable Text format.
Written as a python alternative to Sanity's block-content-to-html npm package, for when you don't have access to a JavaScript runtime.
- Add support for image type
pip install python-sanity-html
To parse your block content as HTML, simply instantiate the parser like this
from sanity_html import SanityBlockRenderer
renderer = SanityBlockRenderer(block_content)
output = renderer.render()
Contributions are always appreciated 👏
For details, see the CONTRIBUTING.md.