diff --git a/packages/website/content/guides/how-to-customize-quill.mdx b/packages/website/content/docs/customization.mdx
similarity index 96%
rename from packages/website/content/guides/how-to-customize-quill.mdx
rename to packages/website/content/docs/customization.mdx
index 22f77d6c8f..70ff1816d9 100644
--- a/packages/website/content/guides/how-to-customize-quill.mdx
+++ b/packages/website/content/docs/customization.mdx
@@ -1,19 +1,17 @@
---
-title: How to Customize Quill
+title: Customization
---
Quill was designed with customization and extension in mind. This is achieved by implementing a small editor core exposed by a granular, well defined [API](/docs/api). The core is augmented by [modules](/docs/modules), using the same [APIs](/docs/api) you have access to.
In general, common customizations are handled in [configurations](#configurations/), user interfaces by [Themes](#themes) and CSS, functionality by [modules](#modules), and editor contents by [Parchment](#content-and-formatting).
-
### Configurations
Quill favors Code over Configuration™, but for very common needs, especially where the equivalent code would be lengthy or complex, Quill provides [configuration](/docs/configuration/) options. This would be a good first place to look to determine if you even need to implement any custom functionality.
Two of the most powerful options is `modules` and `theme`. You can drastically change or expand what Quill can and does do by simply adding or removing individual [modules](/docs/modules/) or using a different [theme](/docs/themes/).
-
### Themes
Quill officially supports a standard toolbar theme [Snow](/docs/themes/#snow) and a floating tooltip theme [Bubble](/docs/themes/#bubble). Since Quill is not confined within an iframe like many legacy editors, many visual modifications can be made with just CSS, using one of the existing themes.
@@ -21,12 +19,11 @@ Quill officially supports a standard toolbar theme [Snow](/docs/themes/#snow) an
If you would like to drastically change UI interactions, you can omit the `theme` configuration option, which will give you an unstyled Quill editor. You do still need to include a minimal stylesheet that, for example, makes sure spaces render in all browsers and ordered lists are appropriately numbered.
```html
-
+
```
From there you can implement and attach your own UI elements like custom dropdowns or tooltips. The last section of [Cloning Medium with Parchment](/guides/cloning-medium-with-parchment/#final-polish) provides an example of this in action.
-
### Modules
Quill is designed with a modular architecture composed of a small editing core, surrounded by modules that augment its functionality. Some of this functionality is quite integral to editing, such as the [History](/docs/modules/history/) module, which manages undo and redo. Because all modules use the same public [API](/docs/api) exposed to the developer, even interchanging core modules is possible, when necessary.
@@ -44,7 +41,7 @@ const quill = new Quill('#editor', {
},
theme: 'snow'
});
-`
+`,
}}
/>
@@ -54,7 +51,6 @@ Nevertheless, staying true to Quill modular design, you can still drastically ch
Finally, you may want to add functionality not provided by existing modules. In this case, it may be convenient to organize this as a Quill module, which the [Building A Custom Module](/guides/building-a-custom-module/) guide covers. Of course, it is certainly valid to just keep this logic separate from Quill, in your application code instead.
-
### Content and Formatting
Quill allows modification and extension of the contents and formats that it understands through its document model [Parchment](https://github.com/quilljs/parchment/). Content and formats are represented in Parchment as either Blots or Attributors, which roughly correspond to Nodes or Attributes in the DOM.
@@ -72,9 +68,9 @@ Quill.register(SizeStyle, true);
// Initialize as you would normally
const quill = new Quill('#editor', {
modules: {
- toolbar: true
+ toolbar: true,
},
- theme: 'snow'
+ theme: 'snow',
});
```
@@ -85,7 +81,11 @@ In addition to choosing the particular Attributor, you can also customize existi
```js
const FontAttributor = Quill.import('attributors/class/font');
FontAttributor.whitelist = [
- 'sofia', 'slabo', 'roboto', 'inconsolata', 'ubuntu'
+ 'sofia',
+ 'slabo',
+ 'roboto',
+ 'inconsolata',
+ 'ubuntu',
];
Quill.register(FontAttributor, true);
```
@@ -93,11 +93,11 @@ Quill.register(FontAttributor, true);
Note you still need to add styling for these classes into your CSS files.
```html
-
+
```
@@ -127,7 +127,7 @@ quill.setContents(
.insert('\\n')
);
`
- }}
+}}
/>
#### Extending Blots
@@ -152,9 +152,9 @@ Quill.register(PlainListItem, true);
// Initialize as you would normally
const quill = new Quill('#editor', {
modules: {
- toolbar: true
+ toolbar: true,
},
- theme: 'snow'
+ theme: 'snow',
});
```
diff --git a/packages/website/content/docs/registries.mdx b/packages/website/content/docs/customization/registries.mdx
similarity index 100%
rename from packages/website/content/docs/registries.mdx
rename to packages/website/content/docs/customization/registries.mdx
diff --git a/packages/website/content/docs/themes.mdx b/packages/website/content/docs/customization/themes.mdx
similarity index 100%
rename from packages/website/content/docs/themes.mdx
rename to packages/website/content/docs/customization/themes.mdx
diff --git a/packages/website/content/guides/building-a-custom-module.mdx b/packages/website/content/docs/guides/building-a-custom-module.mdx
similarity index 100%
rename from packages/website/content/guides/building-a-custom-module.mdx
rename to packages/website/content/docs/guides/building-a-custom-module.mdx
diff --git a/packages/website/content/guides/cloning-medium-with-parchment.js b/packages/website/content/docs/guides/cloning-medium-with-parchment.js
similarity index 100%
rename from packages/website/content/guides/cloning-medium-with-parchment.js
rename to packages/website/content/docs/guides/cloning-medium-with-parchment.js
diff --git a/packages/website/content/guides/cloning-medium-with-parchment.mdx b/packages/website/content/docs/guides/cloning-medium-with-parchment.mdx
similarity index 100%
rename from packages/website/content/guides/cloning-medium-with-parchment.mdx
rename to packages/website/content/docs/guides/cloning-medium-with-parchment.mdx
diff --git a/packages/website/content/guides/designing-the-delta-format.mdx b/packages/website/content/docs/guides/designing-the-delta-format.mdx
similarity index 100%
rename from packages/website/content/guides/designing-the-delta-format.mdx
rename to packages/website/content/docs/guides/designing-the-delta-format.mdx
diff --git a/packages/website/content/guides/upgrading-to-2-0.mdx b/packages/website/content/docs/upgrading-to-2-0.mdx
similarity index 100%
rename from packages/website/content/guides/upgrading-to-2-0.mdx
rename to packages/website/content/docs/upgrading-to-2-0.mdx
diff --git a/packages/website/content/guides/why-quill.mdx b/packages/website/content/docs/why-quill.mdx
similarity index 100%
rename from packages/website/content/guides/why-quill.mdx
rename to packages/website/content/docs/why-quill.mdx
diff --git a/packages/website/next.config.mjs b/packages/website/next.config.mjs
index c8fba63367..ad1465ac6e 100644
--- a/packages/website/next.config.mjs
+++ b/packages/website/next.config.mjs
@@ -9,6 +9,48 @@ export default withMDX()({
},
env: env,
pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'],
+ redirects: () => [
+ {
+ source: '/guides/upgrading-to-2-0',
+ destination: '/docs/upgrading-to-2-0',
+ permanent: true,
+ },
+ {
+ source: '/guides/why-quill',
+ destination: '/docs/why-quill',
+ permanent: true,
+ },
+ {
+ source: '/guides/how-to-customize-quill',
+ destination: '/docs/customization',
+ permanent: true,
+ },
+ {
+ source: '/guides/building-a-custom-module',
+ destination: '/docs/guides/building-a-custom-module',
+ permanent: true,
+ },
+ {
+ source: '/guides/cloning-medium-with-parchment',
+ destination: '/docs/guides/cloning-medium-with-parchment',
+ permanent: true,
+ },
+ {
+ source: '/guides/designing-the-delta-format',
+ destination: '/docs/guides/designing-the-delta-format',
+ permanent: true,
+ },
+ {
+ source: '/docs/registries',
+ destination: '/docs/customization/registries',
+ permanent: true,
+ },
+ {
+ source: '/docs/themes',
+ destination: '/docs/customization/themes',
+ permanent: true,
+ },
+ ],
webpack(config) {
// Grab the existing rule that handles SVG imports
const fileLoaderRule = config.module.rules.find((rule) =>
diff --git a/packages/website/src/components/ActiveLink.jsx b/packages/website/src/components/ActiveLink.jsx
index 0670a587cf..9be46ce3e5 100644
--- a/packages/website/src/components/ActiveLink.jsx
+++ b/packages/website/src/components/ActiveLink.jsx
@@ -5,7 +5,7 @@ import React, { useState, useEffect, useCallback } from 'react';
const ActiveLink = ({
children,
activeClassName,
- className,
+ className = '',
activePath,
...props
}) => {
diff --git a/packages/website/src/components/Header.jsx b/packages/website/src/components/Header.jsx
index dd1bd51727..ab58ba843d 100644
--- a/packages/website/src/components/Header.jsx
+++ b/packages/website/src/components/Header.jsx
@@ -9,7 +9,6 @@ import { DocSearch } from '@docsearch/react';
import { useState } from 'react';
import playground from '../data/playground';
import docs from '../data/docs';
-import guides from '../data/guides';
import ActiveLink from './ActiveLink';
import ClickOutsideHandler from './ClickOutsideHandler';
@@ -23,13 +22,6 @@ const MainNav = ({ ...props }) => {
>
Documentation
-
- Guides
- {
Playground
-