Concepts#

Plone traditionally stored rich-text content as HTML. With the introduction of Volto, content is now structured as blocks (JSON objects that define page layout and content for the Volto frontend). This shift enables a more flexible, component-based editing experience, but also requires new tools for migrating legacy content.

Migration and Extensibility#

Earlier, the Plone community used the Blocks Conversion Tool to convert HTML to Volto blocks during migrations. While effective, it lacked extensibility and only offered an HTTP interface.

collective.html2blocks was designed to address these limitations by:

  • Allowing developers to register new converters for HTML elements, making it easy to adapt or extend block conversion for custom needs.

  • Providing direct Python APIs for integration with migration frameworks such as collective.exportimport, Transmogrifier, or collective.transmute.

  • Emphasizing type annotations and comprehensive test coverage for reliability and maintainability.

Editor Support: Volto-Slate#

Although support for DraftJS (the previous default block editor for Volto) is technically possible, collective.html2blocks focuses on volto-slate, the default rich-text editor since Volto 16. volto-slate is built on top of Slate, providing advanced WYSIWYG capabilities for content editing in Plone.