{ "info": { "author": "Springload", "author_email": "hello@springload.co.nz", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Internet :: WWW/HTTP :: Site Management", "Topic :: Software Development :: Libraries :: Application Frameworks", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Editors :: Word Processors" ], "description": "# Draft.js exporter\n\n[![PyPI](https://img.shields.io/pypi/v/draftjs_exporter.svg)](https://pypi.org/project/draftjs_exporter/) [![Travis](https://travis-ci.org/springload/draftjs_exporter.svg?branch=master)](https://travis-ci.org/springload/draftjs_exporter) [![Coveralls](https://coveralls.io/repos/github/springload/draftjs_exporter/badge.svg?branch=master)](https://coveralls.io/github/springload/draftjs_exporter?branch=master) [![Total alerts](https://img.shields.io/lgtm/alerts/g/springload/draftjs_exporter.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/springload/draftjs_exporter/alerts/) [![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/springload/draftjs_exporter.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/springload/draftjs_exporter/context:python)\n\n\n> Library to convert rich text from Draft.js raw ContentState to HTML.\n\nIt is developed alongside the [Draftail](https://www.draftail.org/) rich text editor, for [Wagtail](https://github.com/wagtail/wagtail). Check out the [online demo](http://playground.draftail.org/), and our [introductory blog post](https://www.draftail.org/blog/2018/03/13/rethinking-rich-text-pipelines-with-draft-js).\n\n## Why\n\n[Draft.js](https://draftjs.org/) is a rich text editor framework for [React](https://reactjs.org/). Its approach is different from most rich text editors because it does not store data as HTML, but rather in its own representation called ContentState. This exporter is useful when the ContentState to HTML conversion has to be done in a Python ecosystem.\n\nThe initial use case was to gain more control over the content managed by rich text editors in a Wagtail/Django site. If you want to read the full story, have a look at our blog post: [Rethinking rich text pipelines with Draft.js](https://www.draftail.org/blog/2018/03/13/rethinking-rich-text-pipelines-with-draft-js).\n\n## Features\n\nThis project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html), and [measures performance](http://blog.thib.me/python-memory-profiling-for-the-draft-js-exporter/) and [code coverage](https://coveralls.io/github/springload/draftjs_exporter).\n\n* Extensive configuration of the generated HTML.\n* Default, extensible block & inline style maps for common HTML elements.\n* Convert line breaks to `
` elements.\n* Define any attribute in the block map \u2013 custom class names for elements.\n* React-like API to create custom components.\n* Automatic conversion of entity data to HTML attributes (int & boolean to string, style object to style string).\n* Nested lists (`
  • ` elements go inside `