Skip to content

Commit abee24e

Browse files
authored
docs: refactor and improve rich text docs (#9929)
- Refactoring that simplifies finding things: ```md ## BEFORE - Rich Text - Overview - Slate - Lexical - Lexical - Overview - Converters - Migration - Custom Features ## AFTER - Rich Text - Overview - Converters - Custom Features - Migration - Slate (legacy) ``` - It takes some of the spotlight away from Slate. Lexical is assumed as the default editor and a banner at the beginning refers to the Slate documentation. - Various writing improvements. PENDING: - [ ] some 301 redirects needed - `/docs/rich-text/lexical` to `/docs/rich-text/overview` - `/docs/lexical/overview` to `/docs/rich-text/overview` - `/docs/lexical/converters` to `/docs/rich-text/converters` - `/docs/lexical/migration` to `/docs/rich-text/migration`
1 parent 0d8643a commit abee24e

File tree

8 files changed

+305
-334
lines changed

8 files changed

+305
-334
lines changed

docs/fields/rich-text.mdx

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ desc: The Rich Text field allows dynamic content to be written through the Admin
66
keywords: rich text, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
77
---
88

9-
The Rich Text Field is a powerful way to allow editors to write dynamic content. The content is saved as JSON in the database and can be converted into any format, including HTML, that you need.
9+
The Rich Text Field lets editors write and format dynamic content in a familiar interface.
10+
The content is saved as JSON in the database and can be converted to HTML or any other format needed.
11+
12+
Consistent with Payload's goal of making you learn as little of Payload as possible, customizing
13+
and using the Rich Text Editor does not involve learning how to develop for a Payload rich text editor.
14+
Instead, you can invest your time and effort into learning the underlying open-source tools that will allow
15+
you to apply your learnings elsewhere as well.
1016

1117
<LightDarkImage
1218
srcLight="https://payloadcms.com/images/docs/fields/richtext.png"
@@ -15,23 +21,6 @@ The Rich Text Field is a powerful way to allow editors to write dynamic content.
1521
caption="Admin Panel screenshot of a Rich Text field"
1622
/>
1723

18-
Payload's rich text field is built on an "adapter pattern" which lets you specify which rich text editor you'd like to use.
19-
20-
Right now, Payload is officially supporting two rich text editors:
21-
22-
1. [SlateJS](/docs/rich-text/slate) - legacy, backwards-compatible with 1.0
23-
2. [Lexical](/docs/lexical/overview) - recommended
24-
25-
<Banner type="success">
26-
<strong>
27-
Consistent with Payload's goal of making you learn as little of Payload as possible, customizing
28-
and using the Rich Text Editor does not involve learning how to develop for a{' '}<em>Payload</em>{' '}rich text editor.
29-
</strong>
30-
31-
Instead, you can invest your time and effort into learning the underlying open-source tools that
32-
will allow you to apply your learnings elsewhere as well.
33-
</Banner>
34-
3524
## Config Options
3625

3726
| Option | Description |
@@ -47,7 +36,7 @@ Right now, Payload is officially supporting two rich text editors:
4736
| **`localized`** | Enable localization for this field. Requires [localization to be enabled](/docs/configuration/localization) in the Base config. |
4837
| **`required`** | Require this field to have a value. |
4938
| **`admin`** | Admin-specific configuration. [More details](#admin-options). |
50-
| **`editor`** | Override the rich text editor specified in your base configuration for this field. |
39+
| **`editor`** | Customize or override the rich text editor. [More details](/docs/rich-text/overview). |
5140
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
5241
| **`typescriptSchema`** | Override field type generation with providing a JSON schema |
5342
| **`virtual`** | Provide `true` to disable field in the database. See [Virtual Fields](https://payloadcms.com/blog/learn-how-virtual-fields-can-help-solve-common-cms-challenges) |
@@ -79,4 +68,5 @@ The Rich Text Field inherits all of the default options from the base [Field Adm
7968

8069
## Editor-specific Options
8170

82-
For a ton more editor-specific options, including how to build custom rich text elements directly into your editor, take a look at either the [Slate docs](/docs/rich-text/slate) or the [Lexical docs](/docs/lexical/overview) depending on which editor you're using.
71+
For a ton more editor-specific options, including how to build custom rich text elements directly into your editor,
72+
take a look at the [rich text editor documentation](/docs/rich-text/overview).

docs/lexical/overview.mdx

Lines changed: 0 additions & 292 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

docs/rich-text/lexical.mdx

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/lexical/migration.mdx renamed to docs/rich-text/migration.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Lexical Migration
33
label: Migration
4-
order: 30
4+
order: 90
55
desc: Migration from slate and payload-plugin-lexical to lexical
66
keywords: lexical, rich text, editor, headless cms, migrate, migration
77
---

0 commit comments

Comments
 (0)