From 86ed0ab9f7a1d7586c6e980548dd78109212b810 Mon Sep 17 00:00:00 2001 From: Charlie Sue <30598038+suxilog@users.noreply.github.com> Date: Wed, 27 Sep 2023 10:50:21 +0800 Subject: [PATCH] Docs - Add note about including the feature in text editor settings --- CHANGELOG.txt | 1 + CONTRIBUTORS.md | 1 + docs/extending/extending_draftail.md | 17 +++++++++++++++++ docs/releases/5.2.md | 1 + 4 files changed, 20 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 935f862684..e6b6e54b29 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -46,6 +46,7 @@ Changelog * Docs: Replace incorrect screenshot for authors listing on tutorial (Shreshth Srivastava) * Docs: Add documentation for building non-model-based choosers using the _queryish_ library (Matt Westcott) * Docs: Fix incorrect tag library import on focal points example (Hatim Makki Hoho) + * Docs: Add reminder about including your custom Draftail feature in any overridden `WAGTAILADMIN_RICH_TEXT_EDITORS` setting (Charlie Sue) * Maintenance: Fix snippet search test to work on non-fallback database backends (Matt Westcott) * Maintenance: Update Eslint, Prettier, Jest, a11y-dialog, axe-core and js-cookie npm packages (LB (Ben) Johnston) * Maintenance: Add npm scripts for TypeScript checks and formatting SCSS files (LB (Ben) Johnston) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 9f0fbacad3..b75661ee11 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -736,6 +736,7 @@ * TopDevPros * Sandra Ashipala * Omkar Jadhav +* Charlie Sue ## Translators diff --git a/docs/extending/extending_draftail.md b/docs/extending/extending_draftail.md index b0075fc706..e2d9829ad5 100644 --- a/docs/extending/extending_draftail.md +++ b/docs/extending/extending_draftail.md @@ -392,6 +392,23 @@ window.draftail.registerPlugin({ }, 'controls'); ``` +```{note} +Remember to include this feature in any custom Draft configs set up in the `WAGTAILADMIN_RICH_TEXT_EDITORS` setting. So that this new 'sentences' feature is available. +``` + +For example: + +```python +WAGTAILADMIN_RICH_TEXT_EDITORS = { + 'default': { + 'WIDGET': 'wagtail.admin.rich_text.DraftailRichTextArea', + 'OPTIONS': { + 'features': ['bold', 'italic', 'link', 'sentences'], # Add 'sentences' here + }, + }, +} +``` + ### Text decorators The [decorators API](https://www.draftail.org/docs/decorators) is how Draftail / Draft.js supports highlighting text with special formatting in the editor. It uses the [CompositeDecorator](https://draftjs.org/docs/advanced-topics-decorators/#compositedecorator) API, with each entry having a `strategy` function to determine what text to target, and a `component` function to render the decoration. diff --git a/docs/releases/5.2.md b/docs/releases/5.2.md index 986beccced..9336b8316b 100644 --- a/docs/releases/5.2.md +++ b/docs/releases/5.2.md @@ -64,6 +64,7 @@ depth: 1 * Replace incorrect screenshot for authors listing on tutorial (Shreshth Srivastava) * Add documentation for building non-model-based choosers using the _queryish_ library (Matt Westcott) * Fix incorrect tag library import on focal points example (Hatim Makki Hoho) + * Add reminder about including your custom Draftail feature in any overridden `WAGTAILADMIN_RICH_TEXT_EDITORS` setting (Charlie Sue) ### Maintenance