Plugin enabling CodeMirror editor for Strapi textaera field.
Please keep in mind that the plugin replaces the textarea field.
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).
- Under the root folder of your project run
NPM:
npm install strapi-plugin-codemirror --save
YARN:
yarn add strapi-plugin-codemirror
- Rebuild admin UI
strapi build
- Run strapi
strapi develop
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"
}
For the available modes read the CodeMirror documentation.
- Test every language mode
- Textarea fallback
- App level settings
- ⋅⋅⋅ Theme select