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:
property js

Loads the Toast UI Editor Javascript files.

Plugins and translations are not loaded by default. Define them in the TUIEditor class 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.

class flask_tui_editor.widgets.TUIEditorWidget

A widget for rendering a Toast UI Editor in a form field.

Methods:
__call__(field, editor_options=’{}’, **kwargs):

Renders the widget as HTML.