Giter Site home page Giter Site logo

use case about draftjs_exporter HOT 3 CLOSED

springload avatar springload commented on May 27, 2024
use case

from draftjs_exporter.

Comments (3)

williamboman avatar williamboman commented on May 27, 2024 2

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.

loicteixeira avatar loicteixeira commented on May 27, 2024

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.

thibaudcolas avatar thibaudcolas commented on May 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.