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

pull/10954/head
Charlie Sue 2023-09-27 10:50:21 +08:00 zatwierdzone przez LB (Ben Johnston)
rodzic 09c125189d
commit 86ed0ab9f7
4 zmienionych plików z 20 dodań i 0 usunięć

Wyświetl plik

@ -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)

Wyświetl plik

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

Wyświetl plik

@ -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.

Wyświetl plik

@ -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