1
0
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:
Renaud Chaput
2018-02-07 15:58:41 +00:00
committed by Ian Storm Taylor
parent fc264841b6
commit de4c9e478a
89 changed files with 1105 additions and 1148 deletions

View File

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

View File

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

View File

@@ -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.|![](https://img.shields.io/npm/dm/slate-auto-replace.svg?maxAge=3600&label=⬇)|
|[`slate-collapse-on-escape`](https://yarnpkg.com/en/package/slate-collapse-on-escape)|Collapse the selection when users hit <kbd>esc</kbd>.|![](https://img.shields.io/npm/dm/slate-collapse-on-escape.svg?maxAge=3600&label=⬇)|
|[`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.|![](https://img.shields.io/npm/dm/slate-drop-or-paste-images.svg?maxAge=3600&label=⬇)|
|[`slate-edit-blockquote`](https://yarnpkg.com/en/package/slate-edit-blockquote)|Adds blockquote editing behaviors to an editor.|![](https://img.shields.io/npm/dm/slate-edit-blockquote.svg?maxAge=3600&label=⬇)|
|[`slate-edit-code`](https://yarnpkg.com/en/package/slate-edit-code)|Adds code block editing behaviors to an editor.|![](https://img.shields.io/npm/dm/slate-edit-code.svg?maxAge=3600&label=⬇)|
|[`slate-edit-footnote`](https://yarnpkg.com/en/package/slate-edit-footnote)|Adds footnote editing behaviors to an editor.|![](https://img.shields.io/npm/dm/slate-edit-footnote.svg?maxAge=3600&label=⬇)|
|[`slate-edit-list`](https://yarnpkg.com/en/package/slate-edit-list)|Adds list editing behaviors to an editor.|![](https://img.shields.io/npm/dm/slate-edit-list.svg?maxAge=3600&label=⬇)|
|[`slate-edit-table`](https://yarnpkg.com/en/package/slate-edit-table)|Adds common table editing behaviors to an editor.|![](https://img.shields.io/npm/dm/slate-edit-table.svg?maxAge=3600&label=⬇)|
|[`slate-no-empty`](https://yarnpkg.com/en/package/slate-no-empty)|Prevents documents from being empty.|![](https://img.shields.io/npm/dm/slate-no-empty.svg?maxAge=3600&label=⬇)|
|[`slate-paste-linkify`](https://yarnpkg.com/en/package/slate-paste-linkify)|Automatically linkify URLs when they are pasted.|![](https://img.shields.io/npm/dm/slate-paste-linkify.svg?maxAge=3600&label=⬇)|
|[`slate-soft-break`](https://yarnpkg.com/en/package/slate-soft-break)|Adds soft breaks when users hit <kbd>enter</kbd>.|![](https://img.shields.io/npm/dm/slate-soft-break.svg?maxAge=3600&label=⬇)|
|[`slate-sticky-inlines`](https://yarnpkg.com/en/package/slate-sticky-inlines)|Changes the inline node behavior to allow editing at the edges.|![](https://img.shields.io/npm/dm/slate-sticky-inlines.svg?maxAge=3600&label=⬇)|
|[`slate-suggestions`](https://yarnpkg.com/en/package/slate-suggestions)|Displays inline auto-completed suggestions.|![](https://img.shields.io/npm/dm/slate-suggestions.svg?maxAge=3600&label=⬇)|
|[`slate-trailing-block`](https://yarnpkg.com/en/package/slate-trailing-block)|Ensure that documents end in a specific kind of block.|![](https://img.shields.io/npm/dm/slate-trailing-block.svg?maxAge=3600&label=⬇)|
| **Plugin** | **Description** | **Downloads** |
| ----------------------------------------------------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| [`slate-auto-replace`](https://yarnpkg.com/en/package/slate-auto-replace) | Automatically transform certain input as a user types. | ![](https://img.shields.io/npm/dm/slate-auto-replace.svg?maxAge=3600&label=⬇) |
| [`slate-collapse-on-escape`](https://yarnpkg.com/en/package/slate-collapse-on-escape) | Collapse the selection when users hit <kbd>esc</kbd>. | ![](https://img.shields.io/npm/dm/slate-collapse-on-escape.svg?maxAge=3600&label=⬇) |
| [`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. | ![](https://img.shields.io/npm/dm/slate-drop-or-paste-images.svg?maxAge=3600&label=⬇) |
| [`slate-edit-blockquote`](https://yarnpkg.com/en/package/slate-edit-blockquote) | Adds blockquote editing behaviors to an editor. | ![](https://img.shields.io/npm/dm/slate-edit-blockquote.svg?maxAge=3600&label=⬇) |
| [`slate-edit-code`](https://yarnpkg.com/en/package/slate-edit-code) | Adds code block editing behaviors to an editor. | ![](https://img.shields.io/npm/dm/slate-edit-code.svg?maxAge=3600&label=⬇) |
| [`slate-edit-footnote`](https://yarnpkg.com/en/package/slate-edit-footnote) | Adds footnote editing behaviors to an editor. | ![](https://img.shields.io/npm/dm/slate-edit-footnote.svg?maxAge=3600&label=⬇) |
| [`slate-edit-list`](https://yarnpkg.com/en/package/slate-edit-list) | Adds list editing behaviors to an editor. | ![](https://img.shields.io/npm/dm/slate-edit-list.svg?maxAge=3600&label=⬇) |
| [`slate-edit-table`](https://yarnpkg.com/en/package/slate-edit-table) | Adds common table editing behaviors to an editor. | ![](https://img.shields.io/npm/dm/slate-edit-table.svg?maxAge=3600&label=⬇) |
| [`slate-no-empty`](https://yarnpkg.com/en/package/slate-no-empty) | Prevents documents from being empty. | ![](https://img.shields.io/npm/dm/slate-no-empty.svg?maxAge=3600&label=⬇) |
| [`slate-paste-linkify`](https://yarnpkg.com/en/package/slate-paste-linkify) | Automatically linkify URLs when they are pasted. | ![](https://img.shields.io/npm/dm/slate-paste-linkify.svg?maxAge=3600&label=⬇) |
| [`slate-soft-break`](https://yarnpkg.com/en/package/slate-soft-break) | Adds soft breaks when users hit <kbd>enter</kbd>. | ![](https://img.shields.io/npm/dm/slate-soft-break.svg?maxAge=3600&label=⬇) |
| [`slate-sticky-inlines`](https://yarnpkg.com/en/package/slate-sticky-inlines) | Changes the inline node behavior to allow editing at the edges. | ![](https://img.shields.io/npm/dm/slate-sticky-inlines.svg?maxAge=3600&label=⬇) |
| [`slate-suggestions`](https://yarnpkg.com/en/package/slate-suggestions) | Displays inline auto-completed suggestions. | ![](https://img.shields.io/npm/dm/slate-suggestions.svg?maxAge=3600&label=⬇) |
| [`slate-trailing-block`](https://yarnpkg.com/en/package/slate-trailing-block) | Ensure that documents end in a specific kind of block. | ![](https://img.shields.io/npm/dm/slate-trailing-block.svg?maxAge=3600&label=⬇) |
### 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.|![](https://img.shields.io/npm/dm/slate-editor-icons.svg?maxAge=3600&label=⬇)|
| **Plugin** | **Description** | **Downloads** |
| ------------------------------------------------------------------------- | ------------------------------------------ | ----------------------------------------------------------------------------- |
| [`slate-editor-icons`](https://yarnpkg.com/en/package/slate-editor-icons) | A set of icons for using in toolbars, etc. | ![](https://img.shields.io/npm/dm/slate-editor-icons.svg?maxAge=3600&label=⬇) |
### 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.|![](https://img.shields.io/npm/dm/slate-base64-serializer.svg?maxAge=3600&label=⬇)|
|[`slate-html-serializer`](https://yarnpkg.com/en/package/slate-html-serializer)|An HTML serializer for Slate documents.|![](https://img.shields.io/npm/dm/slate-html-serializer.svg?maxAge=3600&label=⬇)|
|[`slate-plain-serializer`](https://yarnpkg.com/en/package/slate-plain-serializer)|A plain text serializer for Slate documents.|![](https://img.shields.io/npm/dm/slate-plain-serializer.svg?maxAge=3600&label=⬇)|
| **Plugin** | **Description** | **Downloads** |
| ----------------------------------------------------------------------------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------- |
| [`slate-base64-serializer`](https://yarnpkg.com/en/package/slate-base64-serializer) | A base64 string serializer for Slate documents. | ![](https://img.shields.io/npm/dm/slate-base64-serializer.svg?maxAge=3600&label=⬇) |
| [`slate-html-serializer`](https://yarnpkg.com/en/package/slate-html-serializer) | An HTML serializer for Slate documents. | ![](https://img.shields.io/npm/dm/slate-html-serializer.svg?maxAge=3600&label=⬇) |
| [`slate-plain-serializer`](https://yarnpkg.com/en/package/slate-plain-serializer) | A plain text serializer for Slate documents. | ![](https://img.shields.io/npm/dm/slate-plain-serializer.svg?maxAge=3600&label=⬇) |
### 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.|![](https://img.shields.io/npm/dm/slate-hyperprint.svg?maxAge=3600&label=⬇)|
|[`slate-hyperscript`](https://yarnpkg.com/en/package/slate-hyperscript)|Allows you to express Slate documents in JSX.|![](https://img.shields.io/npm/dm/slate-hyperscript.svg?maxAge=3600&label=⬇)|
|[`slate-prop-types`](https://yarnpkg.com/en/package/slate-prop-types)|A set of prop types to use in your Slate components.|![](https://img.shields.io/npm/dm/slate-prop-types.svg?maxAge=3600&label=⬇)|
| **Plugin** | **Description** | **Downloads** |
| ----------------------------------------------------------------------- | ----------------------------------------------------------- | ---------------------------------------------------------------------------- |
| [`slate-hyperprint`](https://yarnpkg.com/en/package/slate-hyperprint) | Prints Slate documents in their `slate-hyperscript` format. | ![](https://img.shields.io/npm/dm/slate-hyperprint.svg?maxAge=3600&label=⬇) |
| [`slate-hyperscript`](https://yarnpkg.com/en/package/slate-hyperscript) | Allows you to express Slate documents in JSX. | ![](https://img.shields.io/npm/dm/slate-hyperscript.svg?maxAge=3600&label=⬇) |
| [`slate-prop-types`](https://yarnpkg.com/en/package/slate-prop-types) | A set of prop types to use in your Slate components. | ![](https://img.shields.io/npm/dm/slate-prop-types.svg?maxAge=3600&label=⬇) |

View File

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