1.0.4 • Published 3 months ago

@tanglemedia/directus-extension-plainify-flex v1.0.4

Weekly downloads
-
License
-
Repository
-
Last release
3 months ago

@tanglemedia/directus-extension-plainify-flex

This package converts flexible content into a plain content

Requirements

  • Directus >= 10.10.1
  • Node >= 18.x.x

To use this extension, you should have the following installed in your Directus project already:

  • @tanglemedia/directus-collection-flex-editor

Install

  1. npm i @tanglemedia/directus-extension-plainify-flex

How does this extension?

A flexible content is assumed to be in JSON format that follows the tiptap format. Example of it is as follows:

{
  "type": "doc",
  "content": [
    {
      "type": "paragraph",
      "content": [
        {
          "type": "text",
          "text": "Wow, this editor instance exports its content as JSON."
        }
      ]
    }
  ]
}

Then everytime a module that uses the flexible content editor is saved, this extension converts the above JSON format into a plain string.

Wow, this editor instance exports its content as JSON.

As of this writing, paragraphs, headings, lists, blockquote, and codeblocks are the only elements in the flexible content editor that can be converted into plain content.

1.0.4

3 months ago

1.0.3

3 months ago

1.0.2

7 months ago

1.0.1

8 months ago

1.0.0

8 months ago