@plone/blocks-conversion-tool

0.8.2 • Public • Published

Blocks Conversion Tool

NPM Code analysis checks Unit tests

Introduction

This package implements a server with a simple API to convert HTML (as used in Plone Classic) to Blocks (as used on Volto).

Starting the server

From source

git clone https://github.com/plone/blocks-conversion-tool.git
cd blocks-conversion-tool
yarn install
yarn start

To use a different port than 5000 if that one is already opened by another process:

PORT=6000 yarn start

With Docker

docker run -it -p 5000:5000 plone/blocks-conversion-tool:latest

Usage

HTML to Blocks (Slate)

Slate is going to be the default text block for Plone 6, to convert HTML to an array of blocks call the service passing the HTML as shown below:

curl -i -X POST http://localhost:5000/html -H "Accept: application/json" -H "Content-Type: application/json" --data-raw '{"html": "<p>Hello world!</p>"}'

HTML to Blocks (DraftJS)

Draft-JS is the legacy default text block used in Volto.

curl -i -X POST http://localhost:5000/html -H "Accept: application/json" -H "Content-Type: application/json" --data-raw '{"html": "<p>Hello world!</p>", "converter": "draftjs"}'

Developing this package

Commit messages

This package uses @release-it/conventional-changelog to generate its CHANGELOG , so please always prefix your commit messages with:

  • feat : New features
  • fix : Bug fixes
  • refactor : Code changes and refactoring
  • chore: Maintainence tasks

Release

We use release-it to manage version releases of @plone/blocks-conversion-tool. To cut a new release run make release-package.

It is strongly recommended you first do a dry-run with make release-package-dry-run to make sure everything is in order for a new release.

After releasing the package to NPM, also create a new image tag on Docker Hub: make release-image

Readme

Keywords

Package Sidebar

Install

npm i @plone/blocks-conversion-tool

Homepage

plone.org

Weekly Downloads

2

Version

0.8.2

License

MIT

Unpacked Size

110 kB

Total Files

22

Last publish

Collaborators

  • davisagli
  • mrtango
  • petschki
  • mauritsvanrees
  • thet
  • ericof
  • agitator
  • timostollenwerk
  • ramonnb
  • ebrehault
  • robgietema
  • sneridagh