1.0.0-beta.3 • Published 3 years ago

strapi-plugin-codemirror v1.0.0-beta.3

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

Strapi plugin strapi-plugin-codemirror

Plugin enabling CodeMirror editor for Strapi textaera field.

Please keep in mind that the plugin replaces the textarea field.

How it works


The plugin replaces/overrides the textarea field to a CodeMirror field. The field's language can be configured by a model property named mode which defines the CodeMirror mode (available modes).

How to install


  1. Under the root folder of your project run

NPM:

npm install strapi-plugin-codemirror --save

YARN:

yarn add strapi-plugin-codemirror
  1. Rebuild admin UI strapi build
  2. Run strapi strapi develop

How to use


You can define the mode and theme (not implemented yet) attribute as a field property.

Example:

in {your model}.settings.json:

            "condition": {
              "type": "text",
              "mode": "javascript"
              "theme": "material"
            }

alt text

For the available modes read the CodeMirror documentation.

TODO


  • Test every language mode
  • Textarea fallback
  • App level settings
  • ⋅⋅⋅ Theme select