A simple interface to use CKEditor5 with Flask
Project description
Flask-CKEditor-Manager
Flask-CKEditor-Manager (from now on FCKM) provides a simple interface to use CKEDitor5 javascript library with Flask. Greatly inspired by Flask-CKEditor
🚧 This package is under heavy development..
Installation
Install the extension with pip:
pip install flask-ckeditor-manager
Install with poetry:
poetry add flask-ckeditor-manager
Usage
Once installed the FCKM is easy to use. Let's walk through setting up a basic application. Also please note that this is a very basic guide: we will be taking shortcuts here that you should never take in a real application.
To begin we'll set up a Flask app:
from flask import Flask
app = Flask(__name__)
Setting up extension
FCM works via a CKEditorManager object. To kick things off, we'll set up the ckeditor_manager
by instantiating it and telling it about our Flask app:
from flask_ckeditor import CKEditorManager
ckeditor_manager = CKEditorManager()
ckeditor_manager.init_app(app)
Load resources
Once the extension is set up, this will make available the ckeditor
object into the templates context so you could load the javascript package easily, like this.
<head>
{{ ckeditor.load() }}
</head>
Rendering the editor
Once created you can pass the Chart
object to render_template and use it likewise.
<!-- ckeditor.load() must be called before this line -->
<textarea id="editor"></textarea>
<div class="my-classes">{{ ckeditor.config('editor') }}</div>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for flask_ckeditor_manager-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12c2367bc320ade2645388124dbdec3e266a11576ce9b4c2e72640843dd5d224 |
|
MD5 | ffdeb3e5234eaabf777e62c0e55ba8ee |
|
BLAKE2b-256 | a0be149a98b246c2ae6d913f9850a23eb98d2d2b0dd9dc7dcab21cb403d13dbf |
Hashes for flask_ckeditor_manager-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9889252289fa1f8291a666fc07cb1dd2925099360c6913b9c321e52a0f0ecc2 |
|
MD5 | b387b50445b302fdb7cdbe7699fe2ed2 |
|
BLAKE2b-256 | 0d8af43829a3655703891f0ad4904dc4a29dd447668a6f0def0120a443afcd15 |