Skip to content

otovo/python-portabletext-html

Repository files navigation

Package version Code coverage Test status Supported Python versions Checked with mypy

Python Sanity HTML Renderer

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.

TODO

  • Add support for image type

Installation

pip install python-sanity-html

Usage

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()

Contributing

Contributions are always appreciated 👏

For details, see the CONTRIBUTING.md.

Contributors 4

  •  
  •  
  •  
  •  

Languages