mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-29 09:59:48 +02:00
Lint JSON, CSS and Markdown files with Prettier (#1612)
* Process and Lint CSS, Markdown and JSON files with Prettier * Run `yarn prettier` to re-format Markdown, CSS and JSON files
This commit is contained in:
committed by
Ian Storm Taylor
parent
fc264841b6
commit
de4c9e478a
@@ -1,15 +1,14 @@
|
||||
|
||||
# Changelog
|
||||
|
||||
Since Slate is a monorepo with many packages that are versioned separately, we maintain a changelog for each individual package:
|
||||
|
||||
- [`slate`](https://github.com/ianstormtaylor/slate/tree/master/packages/slate/Changelog.md)
|
||||
- [`slate-base64-serializer`](https://github.com/ianstormtaylor/slate/tree/master/packages/slate-base64-serializer/Changelog.md)
|
||||
- [`slate-dev-logger`](https://github.com/ianstormtaylor/slate/tree/master/packages/slate-dev-logger/Changelog.md)
|
||||
- [`slate-html-serializer`](https://github.com/ianstormtaylor/slate/tree/master/packages/slate-html-serializer/Changelog.md)
|
||||
- [`slate-hyperscript`](https://github.com/ianstormtaylor/slate/tree/master/packages/slate-hyperscript/Changelog.md)
|
||||
- [`slate-plain-serializer`](https://github.com/ianstormtaylor/slate/tree/master/packages/slate-plain-serializer/Changelog.md)
|
||||
- [`slate-prop-types`](https://github.com/ianstormtaylor/slate/tree/master/packages/slate-prop-types/Changelog.md)
|
||||
- [`slate-react`](https://github.com/ianstormtaylor/slate/tree/master/packages/slate-react/Changelog.md)
|
||||
- [`slate-schema-violations`](https://github.com/ianstormtaylor/slate/tree/master/packages/slate-schema-violations/Changelog.md)
|
||||
- [`slate-simulator`](https://github.com/ianstormtaylor/slate/tree/master/packages/slate-simulator/Changelog.md)
|
||||
* [`slate`](https://github.com/ianstormtaylor/slate/tree/master/packages/slate/Changelog.md)
|
||||
* [`slate-base64-serializer`](https://github.com/ianstormtaylor/slate/tree/master/packages/slate-base64-serializer/Changelog.md)
|
||||
* [`slate-dev-logger`](https://github.com/ianstormtaylor/slate/tree/master/packages/slate-dev-logger/Changelog.md)
|
||||
* [`slate-html-serializer`](https://github.com/ianstormtaylor/slate/tree/master/packages/slate-html-serializer/Changelog.md)
|
||||
* [`slate-hyperscript`](https://github.com/ianstormtaylor/slate/tree/master/packages/slate-hyperscript/Changelog.md)
|
||||
* [`slate-plain-serializer`](https://github.com/ianstormtaylor/slate/tree/master/packages/slate-plain-serializer/Changelog.md)
|
||||
* [`slate-prop-types`](https://github.com/ianstormtaylor/slate/tree/master/packages/slate-prop-types/Changelog.md)
|
||||
* [`slate-react`](https://github.com/ianstormtaylor/slate/tree/master/packages/slate-react/Changelog.md)
|
||||
* [`slate-schema-violations`](https://github.com/ianstormtaylor/slate/tree/master/packages/slate-schema-violations/Changelog.md)
|
||||
* [`slate-simulator`](https://github.com/ianstormtaylor/slate/tree/master/packages/slate-simulator/Changelog.md)
|
||||
|
@@ -1,12 +1,10 @@
|
||||
|
||||
# FAQ
|
||||
|
||||
A series of common questions people have about Slate:
|
||||
|
||||
- [Why is content pasted as plain text?](#why-is-content-is-pasted-as-plain-text)
|
||||
- [What can a `Block` node have as its children?](#what-can-a-block-node-have-as-its-children)
|
||||
- [What browsers and devices does Slate support?](#what-browsers-and-devices-does-slate-support)
|
||||
|
||||
* [Why is content pasted as plain text?](#why-is-content-is-pasted-as-plain-text)
|
||||
* [What can a `Block` node have as its children?](#what-can-a-block-node-have-as-its-children)
|
||||
* [What browsers and devices does Slate support?](#what-browsers-and-devices-does-slate-support)
|
||||
|
||||
### Why is content pasted as plain text?
|
||||
|
||||
@@ -16,14 +14,12 @@ For this most part, this leads to increased flexbility without many downsides, b
|
||||
|
||||
Since Slate knows nothing about your schema, it can't know how to parse pasted HTML content (or other content). So, by default whenever a user pastes content into a Slate editor, it will parse it as plain text. If you want it to be smarter about pasted content, you need to define an [`onPaste`](../reference/slate-react/editor.md#onpaste) handler that parses the content as you wish.
|
||||
|
||||
|
||||
### What can a `Block` node have as its children?
|
||||
|
||||
With Slate, you can use `Block` node to created complex nested structures. Block nodes may contain nested block nodes (both void and non-void), inline nodes, text nodes and just regular DOM elements (with `contentEditable = {false}`).
|
||||
|
||||
If you have an element that is not going to be editable, you can choose between a `void` node or just a DOM element with `contentEditable = {false}`. Opt for the `void` node if you would like it represented in the Slate schema, and for Slate to be aware of it.
|
||||
|
||||
|
||||
### What browsers and devices does Slate support?
|
||||
|
||||
Slate's goal is to support all the modern browsers on both desktop and mobile devices.
|
||||
|
@@ -1,57 +1,52 @@
|
||||
|
||||
# Plugins
|
||||
|
||||
Here's a list of Slate plugins, organized by category, so that they're easier to find than searching NPM or Yarn.
|
||||
|
||||
|
||||
### Behavior
|
||||
|
||||
Plugins that add specific behaviors to your editor.
|
||||
|
||||
|**Plugin**|**Description**|**Downloads**|
|
||||
|---|---|---|
|
||||
|[`slate-auto-replace`](https://yarnpkg.com/en/package/slate-auto-replace)|Automatically transform certain input as a user types.||
|
||||
|[`slate-collapse-on-escape`](https://yarnpkg.com/en/package/slate-collapse-on-escape)|Collapse the selection when users hit <kbd>esc</kbd>.||
|
||||
|[`slate-drop-or-paste-images`](https://yarnpkg.com/en/package/slate-drop-or-paste-images)|Allows users to insert images by drag-dropping or copy-pasting.||
|
||||
|[`slate-edit-blockquote`](https://yarnpkg.com/en/package/slate-edit-blockquote)|Adds blockquote editing behaviors to an editor.||
|
||||
|[`slate-edit-code`](https://yarnpkg.com/en/package/slate-edit-code)|Adds code block editing behaviors to an editor.||
|
||||
|[`slate-edit-footnote`](https://yarnpkg.com/en/package/slate-edit-footnote)|Adds footnote editing behaviors to an editor.||
|
||||
|[`slate-edit-list`](https://yarnpkg.com/en/package/slate-edit-list)|Adds list editing behaviors to an editor.||
|
||||
|[`slate-edit-table`](https://yarnpkg.com/en/package/slate-edit-table)|Adds common table editing behaviors to an editor.||
|
||||
|[`slate-no-empty`](https://yarnpkg.com/en/package/slate-no-empty)|Prevents documents from being empty.||
|
||||
|[`slate-paste-linkify`](https://yarnpkg.com/en/package/slate-paste-linkify)|Automatically linkify URLs when they are pasted.||
|
||||
|[`slate-soft-break`](https://yarnpkg.com/en/package/slate-soft-break)|Adds soft breaks when users hit <kbd>enter</kbd>.||
|
||||
|[`slate-sticky-inlines`](https://yarnpkg.com/en/package/slate-sticky-inlines)|Changes the inline node behavior to allow editing at the edges.||
|
||||
|[`slate-suggestions`](https://yarnpkg.com/en/package/slate-suggestions)|Displays inline auto-completed suggestions.||
|
||||
|[`slate-trailing-block`](https://yarnpkg.com/en/package/slate-trailing-block)|Ensure that documents end in a specific kind of block.||
|
||||
|
||||
| **Plugin** | **Description** | **Downloads** |
|
||||
| ----------------------------------------------------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
||||
| [`slate-auto-replace`](https://yarnpkg.com/en/package/slate-auto-replace) | Automatically transform certain input as a user types. |  |
|
||||
| [`slate-collapse-on-escape`](https://yarnpkg.com/en/package/slate-collapse-on-escape) | Collapse the selection when users hit <kbd>esc</kbd>. |  |
|
||||
| [`slate-drop-or-paste-images`](https://yarnpkg.com/en/package/slate-drop-or-paste-images) | Allows users to insert images by drag-dropping or copy-pasting. |  |
|
||||
| [`slate-edit-blockquote`](https://yarnpkg.com/en/package/slate-edit-blockquote) | Adds blockquote editing behaviors to an editor. |  |
|
||||
| [`slate-edit-code`](https://yarnpkg.com/en/package/slate-edit-code) | Adds code block editing behaviors to an editor. |  |
|
||||
| [`slate-edit-footnote`](https://yarnpkg.com/en/package/slate-edit-footnote) | Adds footnote editing behaviors to an editor. |  |
|
||||
| [`slate-edit-list`](https://yarnpkg.com/en/package/slate-edit-list) | Adds list editing behaviors to an editor. |  |
|
||||
| [`slate-edit-table`](https://yarnpkg.com/en/package/slate-edit-table) | Adds common table editing behaviors to an editor. |  |
|
||||
| [`slate-no-empty`](https://yarnpkg.com/en/package/slate-no-empty) | Prevents documents from being empty. |  |
|
||||
| [`slate-paste-linkify`](https://yarnpkg.com/en/package/slate-paste-linkify) | Automatically linkify URLs when they are pasted. |  |
|
||||
| [`slate-soft-break`](https://yarnpkg.com/en/package/slate-soft-break) | Adds soft breaks when users hit <kbd>enter</kbd>. |  |
|
||||
| [`slate-sticky-inlines`](https://yarnpkg.com/en/package/slate-sticky-inlines) | Changes the inline node behavior to allow editing at the edges. |  |
|
||||
| [`slate-suggestions`](https://yarnpkg.com/en/package/slate-suggestions) | Displays inline auto-completed suggestions. |  |
|
||||
| [`slate-trailing-block`](https://yarnpkg.com/en/package/slate-trailing-block) | Ensure that documents end in a specific kind of block. |  |
|
||||
|
||||
### Components
|
||||
|
||||
Components for building Slate editors.
|
||||
|
||||
|**Plugin**|**Description**|**Downloads**|
|
||||
|---|---|---|
|
||||
|[`slate-editor-icons`](https://yarnpkg.com/en/package/slate-editor-icons)|A set of icons for using in toolbars, etc.||
|
||||
|
||||
| **Plugin** | **Description** | **Downloads** |
|
||||
| ------------------------------------------------------------------------- | ------------------------------------------ | ----------------------------------------------------------------------------- |
|
||||
| [`slate-editor-icons`](https://yarnpkg.com/en/package/slate-editor-icons) | A set of icons for using in toolbars, etc. |  |
|
||||
|
||||
### Serializers
|
||||
|
||||
Serializers for handling Slate data.
|
||||
|
||||
|**Plugin**|**Description**|**Downloads**|
|
||||
|---|---|---|
|
||||
|[`slate-base64-serializer`](https://yarnpkg.com/en/package/slate-base64-serializer)|A base64 string serializer for Slate documents.||
|
||||
|[`slate-html-serializer`](https://yarnpkg.com/en/package/slate-html-serializer)|An HTML serializer for Slate documents.||
|
||||
|[`slate-plain-serializer`](https://yarnpkg.com/en/package/slate-plain-serializer)|A plain text serializer for Slate documents.||
|
||||
|
||||
| **Plugin** | **Description** | **Downloads** |
|
||||
| ----------------------------------------------------------------------------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------- |
|
||||
| [`slate-base64-serializer`](https://yarnpkg.com/en/package/slate-base64-serializer) | A base64 string serializer for Slate documents. |  |
|
||||
| [`slate-html-serializer`](https://yarnpkg.com/en/package/slate-html-serializer) | An HTML serializer for Slate documents. |  |
|
||||
| [`slate-plain-serializer`](https://yarnpkg.com/en/package/slate-plain-serializer) | A plain text serializer for Slate documents. |  |
|
||||
|
||||
### Utils
|
||||
|
||||
Useful utilities when working with Slate documents and components.
|
||||
|
||||
|**Plugin**|**Description**|**Downloads**|
|
||||
|---|---|---|
|
||||
|[`slate-hyperprint`](https://yarnpkg.com/en/package/slate-hyperprint)|Prints Slate documents in their `slate-hyperscript` format.||
|
||||
|[`slate-hyperscript`](https://yarnpkg.com/en/package/slate-hyperscript)|Allows you to express Slate documents in JSX.||
|
||||
|[`slate-prop-types`](https://yarnpkg.com/en/package/slate-prop-types)|A set of prop types to use in your Slate components.||
|
||||
| **Plugin** | **Description** | **Downloads** |
|
||||
| ----------------------------------------------------------------------- | ----------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
||||
| [`slate-hyperprint`](https://yarnpkg.com/en/package/slate-hyperprint) | Prints Slate documents in their `slate-hyperscript` format. |  |
|
||||
| [`slate-hyperscript`](https://yarnpkg.com/en/package/slate-hyperscript) | Allows you to express Slate documents in JSX. |  |
|
||||
| [`slate-prop-types`](https://yarnpkg.com/en/package/slate-prop-types) | A set of prop types to use in your Slate components. |  |
|
||||
|
@@ -1,21 +1,17 @@
|
||||
|
||||
# Resources
|
||||
|
||||
A few resources that are helpful for building with Slate.
|
||||
|
||||
|
||||
## Libraries
|
||||
|
||||
- [`is-hotkey`](https://github.com/ianstormtaylor/is-hotkey) is a simple way to check whether an `onKeyDown` handler should fire for a given hotkey, handling cross-platform concerns like <kbd>cmd</kbd> vs. <kbd>ctrl</kbd> keys for you automatically.
|
||||
- [`react-broadcast`](https://github.com/ReactTraining/react-broadcast) works well when you need to have your custom node components re-render based on state that lives outside the `document`. It's the same pattern that `react-router` uses to update `<Link>` components.
|
||||
|
||||
* [`is-hotkey`](https://github.com/ianstormtaylor/is-hotkey) is a simple way to check whether an `onKeyDown` handler should fire for a given hotkey, handling cross-platform concerns like <kbd>cmd</kbd> vs. <kbd>ctrl</kbd> keys for you automatically.
|
||||
* [`react-broadcast`](https://github.com/ReactTraining/react-broadcast) works well when you need to have your custom node components re-render based on state that lives outside the `document`. It's the same pattern that `react-router` uses to update `<Link>` components.
|
||||
|
||||
## Tooling
|
||||
|
||||
- [Immutable.js Console Extension](https://github.com/mattzeunert/immutable-object-formatter-extension) — this greatly improves the `console.log` output when working with [Immutable.js](https://facebook.github.io/immutable-js/) objects, which Slate's data model is based on.
|
||||
|
||||
* [Immutable.js Console Extension](https://github.com/mattzeunert/immutable-object-formatter-extension) — this greatly improves the `console.log` output when working with [Immutable.js](https://facebook.github.io/immutable-js/) objects, which Slate's data model is based on.
|
||||
|
||||
## Showcase
|
||||
|
||||
- [ORY Editor](https://editor.ory.am/) — a self-contained, inline WYSIWYG editor library built on top of Slate.
|
||||
- [Nossas Editor](http://slate-editor.bonde.org/) — a drop-in WYSIWYG editor built with Slate.
|
||||
* [ORY Editor](https://editor.ory.am/) — a self-contained, inline WYSIWYG editor library built on top of Slate.
|
||||
* [Nossas Editor](http://slate-editor.bonde.org/) — a drop-in WYSIWYG editor built with Slate.
|
||||
|
Reference in New Issue
Block a user