EditorJS as a widget for Wagtail, with Page- and Image chooser support
Project description
wagtail_editorjs
A Wagtail EditorJS widget with page/image chooser support, document support and more!
Quick start
-
Add 'wagtail_editorjs' to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ..., 'wagtail_editorjs', ]
-
Add the HTML to your template:
<link rel="stylesheet" href="{% static 'wagtail_editorjs/css/frontend.css' %}"> {% load editorjs %} {% editorjs self.editor_field %}
-
Add the field to your model:
... from wagtail_editorjs.fields import EditorJSField class HomePage(Page): content_panels = [ FieldPanel("editor_field"), ] editor_field = EditorJSField( # All supported features features=[ 'attaches', 'checklist', 'code', 'delimiter', 'document', 'drag-drop', 'header', 'image', 'inline-code', 'link', 'marker', 'nested-list', 'paragraph', 'quote', 'raw', 'table', 'text-alignment-tune', 'text-variant-tune', 'underline', 'undo-redo', 'warning', ], blank=True, null=True, )
Settings
EDITORJS_CLEAN_HTML
Default: True
Clean the HTML output on rendering.
This happens every time the field is rendered.
It might be smart to set up some sort of caching mechanism.
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
wagtail_editorjs-1.2.4.tar.gz
(164.8 kB
view details)
File details
Details for the file wagtail_editorjs-1.2.4.tar.gz
.
File metadata
- Download URL: wagtail_editorjs-1.2.4.tar.gz
- Upload date:
- Size: 164.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4f48722c3dd163a013d051f54d8d54c6298b25c1f6c927d82db74c61323c13f |
|
MD5 | f4a59dc19ccb9e1299e8279e7963080a |
|
BLAKE2b-256 | 1627b3217e5db1593e3aff2876a539f63b4015aee9dbeff27674cc1ddbc187cc |