API¶
- class flask_tui_editor.ext.TUIEditor(app, translations=(), plugins=())¶
Toast UI Editor class
Usage Model
app = Flask(__name__) flask_tui_editor = TUIEditor(app=app, translations=["tr"], plugins=["uml", "chart"])
or
flask_tui_editor = TUIEditor() def create_app(): app = Flask(__name__) flask_tui_editor.init_app(app, translations=["tr"], plugins=["uml", "chart"]) return app
- init_app(app: object, translations: list = (), plugins: list = ()) object¶
- Parameters:
app – Flask application
translations – List of I18N language codes supported by Toast UI editor. See: https://github.com/nhn/tui.editor/blob/master/docs/en/i18n.md
plugins – List of plugin names supported by Toast UI editor. See: https://github.com/nhn/tui.editor/blob/master/docs/en/plugin.md
- property js¶
Loads the Toast UI Editor Javascript files.
Plugins and translations are not loaded by default. Define them in the
TUIEditorclass in order to use them.Accessible as
{{flask_tui_editor.js}}in Jinja2.
- property css¶
Loads the Toast UI Editor Javascript files.
Accessible as
{{flask_tui_editor.js}}in Jinja2.
- class flask_tui_editor.fields.TUIEditorField(label=None, validators=None, editor_options='{}', **kwargs)¶
A form field with a TUI editor widget.
- Args:
label (str, optional): The label for the field. validators (list, optional): A sequence of validators to use. editor_options (str, optional): JSON string of options for the editor. Defaults to empty json string2. **kwargs: Additional keyword arguments.
- process_formdata(valuelist)¶
Process data received over the wire from a form.
This will be called during form construction with data supplied through the formdata argument.
- Parameters:
valuelist – A list of strings to process.