Lektor plugin for editing with the TinyMCE text editor.
Install the plugin from pypi with one of the standard ways.
This plugin uses non-API mechanisms in Lektor/Flask to inject its own code into the admin Jinja template. As a result, future changes to the Lektor admin backend or frontend code may break compatibility. Version 0.6 should be compatible with Lektor versions starting from 3.3.6.
The TinyMCE API key must be placed in a configs/tinymce.ini file (relative to your Lektor project directory), under the following section:
[licence]
api-key = "YOUR_API_KEY_HERE"
To pass additional arguments (e.g. a list of plugins) into tinymce.init(), use the config section of the configs/tinymce.ini file:
[config]
settings = "branding: false, plugins: 'image link lists autoresize table'"
Note: This string is passed directly to tinymce.init(), so it must follow the proper JavaScript format. Some plugins, such as image upload, may not be fully integrated with Lektor by default.
A new option named targets
has been added to the [config]
section. It specifies which fields should use the TinyMCE editor. The value must be a JavaScript array of field labels (i.e., the text in the grey rectangle at the top left of each field in the admin editor):
[config]
targets = "['Body', 'Page text']"
Additionally, a force-refresh
option has been introduced. If set to "true", the admin page will reload on URL change:
[config]
force-refresh = "true"
The plugin is distributed under the MIT license