Browse Source

Docs - Add note about including the feature in text editor settings

Charlie Sue 1 year ago
parent
commit
86ed0ab9f7
4 changed files with 20 additions and 0 deletions
  1. 1 0
      CHANGELOG.txt
  2. 1 0
      CONTRIBUTORS.md
  3. 17 0
      docs/extending/extending_draftail.md
  4. 1 0
      docs/releases/5.2.md

+ 1 - 0
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)

+ 1 - 0
CONTRIBUTORS.md

@@ -736,6 +736,7 @@
 * TopDevPros
 * Sandra Ashipala
 * Omkar Jadhav
+* Charlie Sue
 
 ## Translators
 

+ 17 - 0
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.

+ 1 - 0
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