Skip to content

Commit e51aec3

Browse files
committed
Docs update
1 parent 2d67f66 commit e51aec3

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

README.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,35 @@ Example::
156156

157157
TEXT_EDITOR = "djangocms_text.contrib.text_ckeditor4.ckeditor4"
158158

159+
Rich text editor configuration
160+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
161+
162+
The ``TEXT_EDITOR`` setting points to a ``RTEConfig`` object. You can create your custom
163+
``RTEConfig`` instance. The following attributes are available:
164+
165+
- name (str): The name of the RTE configuration.
166+
- config (str): The configuration string.
167+
- js (Iterable[str]): An iterable of JavaScript files to include.
168+
- css (dict): A dictionary of CSS files to include.
169+
- admin_css (Iterable[str]): An iterable of CSS files for the admin interface only.
170+
- inline_editing (bool): Whether to enable inline editing.
171+
- child_plugin_support (bool): Whether to support child plugins.
159172

173+
The default configuration is:
174+
175+
.. code-block:: python
176+
RTEConfig(
177+
name="tiptap",
178+
config="TIPTAP",
179+
js=("djangocms_text/bundles/bundle.tiptap.min.js",),
180+
css={"all": ("djangocms_text/css/bundle.tiptap.min.css",)},
181+
admin_css=("djangocms_text/css/tiptap.admin.css",),
182+
inline_editing=True,
183+
child_plugin_support=True,
184+
)
185+
186+
You can use the ``admin_css`` attribute to include CSS files that you need to be loaded into the
187+
dialog window, e.g., to declare custom colors or other styles.
160188

161189
Inline editing feature
162190
~~~~~~~~~~~~~~~~~~~~~~

djangocms_text/editors.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,12 +433,18 @@ class RTEConfig:
433433
config (str): The configuration string.
434434
js (Iterable[str]): An iterable of JavaScript files to include.
435435
css (dict): A dictionary of CSS files to include.
436+
admin_css (Iterable[str]): An iterable of CSS files for the admin interface only.
437+
inline_editing (bool): Whether to enable inline editing.
438+
child_plugin_support (bool): Whether to support child plugins.
436439
437440
Attributes:
438441
name (str): The name of the RTE configuration.
439442
config (str): The configuration string.
440443
js (Iterable[str]): An iterable of JavaScript files to include.
441444
css (dict): A dictionary of CSS files to include.
445+
admin_css (Iterable[str]): An iterable of CSS files for the admin interface only.
446+
inline_editing (bool): Whether to enable inline editing.
447+
child_plugin_support (bool): Whether to support child plugins.
442448
"""
443449

444450
def __init__(

0 commit comments

Comments
 (0)