Tags

external
Rich text

On this page

Structure
Libraries

Structure

Our rich text format is a particular JSON structure. This is handy for rendering one text on different platforms: Web, Android, iOS, etc. It also makes it easy to sprinkle custom components into rich text.

Here is an example (this headline and first paragraph) of what such json structure might look like:

{
   "type":"doc",
   "content":[
      {
         "type":"heading",
         "attrs":{
            "textAlign":"left",
            "level":1
         },
         "content":[
            {
               "type":"text",
               "text":"Structure"
            }
         ]
      },
      {
         "type":"paragraph",
         "attrs":{
            "textAlign":"left"
         },
         "content":[
            {
               "type":"text",
               "text":"Our rich text format is a particular "
            },
            {
               "type":"text",
               "marks":[
                  {
                     "type":"bold"
                  }
               ],
               "text":"JSON"
            },
            {
               "type":"text",
               "text":" structure. This is handy for rendering one text on different platforms: Web, Android, iOS, etc. It also makes it easy to sprinkle "
            },
            {
               "type":"text",
               "marks":[
                  {
                     "type":"bold"
                  }
               ],
               "text":"custom components "
            },
            {
               "type":"text",
               "text":"into rich text."
            }
         ]
      }
   ]
}

If you rendered the above JSON structure to plain HTML, it would look like the following:

<h1>Structure</h1>
<p>Our rich text format is a particular <strong>JSON</strong> structure. This is handy for rendering one text on different platforms: Web, Android, iOS, etc. It also makes it easy to sprinkle <strong>custom components </strong>into rich text.</p>

Libraries

We have different libraries depending on your platform to render the JSON format:

All of these packages are available open source under this repository.

Tags

external
Rich text

On this page

Structure
Libraries