Skip to content

AladdiX/rawdraftjs-to-tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

rawdraftjs-to-tree

Converts a RawDraftContentState to a tree

TL;DR This library is supposed to give full flexibility for generating renderable output from a RawDraftContentState. It provides a more processable format: a tree.

An example of how HTML would be generated out of the tree lives here.

Installation

npm install rawdraftjs-to-tree --save

Usage

import getContentTree from 'rawdraftjs-to-tree';

const tree = getContentTree(contentState);

Where contentState is instance of RawDraftContentState.

The output, in this case, tree will be a JSON following this schema.

And then what ?

Using the output tree you can go creative on what your final output is: good old HTML, React components or generate something else.

Maybe in our world there lives a happy little tree over there 🌲 🌳

- Bob Ross

About

Converts a RawDraftContentState to a tree 🌲

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published