Comments (3)
Just sharing our use case:
We allow users to write comments on articles using a rich text draft-js editor. We run Python in the back and in order for us to embed comments in notification emails that we send out we need to transform draft-js content state JSON structures stored in our database to HTML, which this package does wonderfully.
from draftjs_exporter.
Hi @MalikRumi,
TL;DR;
If you use Draft.js in the admin of your website to create content, you'll need this package to render that content to HTML if your back-end application is written in Python.
Longer version:
Draft.js is a rich text editor framework for React. It differs from other rich text editors like Hallo.js or TinyMCE (at least as far as we're concerned here) because it does not save data as HTML but rather as JSON.
Now this is a problem if you want to render on the front-end what you see in the editor. Before you had HTML so you could display it directly but now you have JSON and it needs to be transformed. This is exactly what this project does. It will convert the JSON output of Draft.js (called the ContentState
) to HTML.
To give you a bigger picture, you could look at our other project WagtailDraftail which integrates Draft.js into the admin interface of Wagtail on one side and uses draftjs_exporter
to then render it.
from draftjs_exporter.
Hey @MalikRumi, I'll close this as I think @loicteixeira covers the "why", and I've added some notes in the README to formalise this.
Feel free to continue the conversation further here if you need more details or think we could communicate the use case better.
If other people stumble upon this issue, we would be really interested to hear what they use this for or as part of which project!
The pypi infrastructure doesn't offer any statistics at the moment, but back when it did this project had about 50-100 downloads / week so I'm sure there is someone out there finding it useful for other purposes than our own π .
Output from vanity
for reference:
$ vanity draftjs_exporter
draftjs_exporter-0.1.0.tar.gz 2016-07-04 198
draftjs_exporter-0.2.0.tar.gz 2016-07-05 174
draftjs_exporter-0.3.0.tar.gz 2016-07-20 116
draftjs_exporter-0.3.1.tar.gz 2016-07-20 126
draftjs_exporter-0.3.2.tar.gz 2016-07-25 482
draftjs_exporter-0.3.3.tar.gz 2016-10-06 182
draftjs_exporter-0.4.0.tar.gz 2016-10-17 117
draftjs_exporter-0.5.0.tar.gz 2016-11-17 58
draftjs_exporter-0.5.1.tar.gz 2016-11-17 102
draftjs_exporter-0.5.2.tar.gz 2016-12-09 58
draftjs_exporter-0.6.0.tar.gz 2016-12-19 56
draftjs_exporter-0.6.1.tar.gz 2016-12-21 78
draftjs_exporter-0.6.2.tar.gz 2017-01-18 30
draftjs_exporter-0.7.0.tar.gz 2017-02-16 13
draftjs_exporter-0.8.0.tar.gz 2017-04-03 21
draftjs_exporter-0.8.1.tar.gz 2017-04-06 191
draftjs_exporter-0.9.0.tar.gz 2017-04-25 0
draftjs_exporter-1.0.0.tar.gz 2017-04-25 0
--------------------------------------------------------
draftjs_exporter has been downloaded 2,002 times!
*** Note: PyPI stats are broken again; we're now waiting for warehouse. https://github.com/aclark4life/vanity/issues/22 ***
from draftjs_exporter.
Related Issues (20)
- Experiment with PEP-484 type hints HOT 1
- Provide readme in reStructuredText format for pypi HOT 8
- Entities with adjacent offset are rendered incorrectly HOT 6
- Drop support for Python 2.7
- QUESTION - Can I create JSON from HTML with this code? HOT 2
- DOM class variable issue with multiple engines (draftjs_exporter_markdown) HOT 4
- Publish as a wheel βΒ and hash issues with newly-published distributions on existing releases v2.1.7, v2.1.6, v2.1.5 HOT 5
- Nested inline style configuration question HOT 3
- Is it possible to export draftjs state as plain text (i.e., without any html tags) HOT 1
- How to interlink with mathjax to export math equations HTML HOT 1
- How to apply text align inline style inside header tag? HOT 1
- Improve dependencies compatibility definition, and testing HOT 3
- Change default engine to the new dependency-free one introduced in #77 HOT 4
- Exporter loads the html5lib engine even if it isn't used HOT 1
- style_map components should be given data on render
- Entity renderers should be given more data on render HOT 1
- Unicode decode error installing on Ubuntu 16.04 HOT 2
- Unicode decode reading markdown file HOT 4
- Missing git tags for 2.1.1 HOT 2
- The setup.py in windows can cause a encoding error. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from draftjs_exporter.