From 17c22b8a2bdd1b3aeddb7407dd483ffa7d8b4d39 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Tue, 15 Sep 2020 21:07:16 +0200 Subject: [PATCH] add more content everywhere --- docs/src/docPages/api/editor.md | 20 +++++++++++++++++++- docs/src/docPages/guide/configuration.md | 10 ++++------ docs/src/docPages/overview/contributing.md | 17 +++++++++++++---- docs/src/docPages/overview/roadmap.md | 3 --- docs/src/docPages/overview/sponsoring.md | 3 --- docs/src/docPages/overview/upgrade-guide.md | 17 ++++++++++------- docs/src/layouts/App/index.vue | 4 ---- docs/src/links.yaml | 9 --------- 8 files changed, 46 insertions(+), 37 deletions(-) delete mode 100644 docs/src/docPages/overview/roadmap.md delete mode 100644 docs/src/docPages/overview/sponsoring.md diff --git a/docs/src/docPages/api/editor.md b/docs/src/docPages/api/editor.md index 35ca120e..5c44870a 100644 --- a/docs/src/docPages/api/editor.md +++ b/docs/src/docPages/api/editor.md @@ -4,4 +4,22 @@ This content is written for tiptap 1 and needs an update. ::: -This class is a central building block of tiptap. It does most of the heavy lifting of creating a working [ProseMirror](https://ProseMirror.net/) editor such as creating the [`EditorView`](https://ProseMirror.net/docs/ref/#view.EditorView), setting the initial [`EditorState`](https://ProseMirror.net/docs/ref/#state.Editor_State) and so on. \ No newline at end of file +This class is a central building block of tiptap. It does most of the heavy lifting of creating a working [ProseMirror](https://ProseMirror.net/) editor such as creating the [`EditorView`](https://ProseMirror.net/docs/ref/#view.EditorView), setting the initial [`EditorState`](https://ProseMirror.net/docs/ref/#state.Editor_State) and so on. + +## Editor Properties +| Property | Type | Default | Description | +| ---------------------- | :--------------: | :---------: | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content` | `Object\|String` | `null` | The editor state object used by Prosemirror. You can also pass HTML to the `content` slot. When used both, the `content` slot will be ignored. | +| `editorProps` | `Object` | `{}` | A list of [Prosemirror editorProps](https://prosemirror.net/docs/ref/#view.EditorProps). | +| `editable` | `Boolean` | `true` | When set to `false` the editor is read-only. | +| `autoFocus` | `Boolean` | `false` | Focus the editor on init. | +| `extensions` | `Array` | `[]` | A list of extensions used, by the editor. This can be `Nodes`, `Marks` or `Plugins`. | +| `useBuiltInExtensions` | `Boolean` | `true` | By default tiptap adds a `Doc`, `Paragraph` and `Text` node to the Prosemirror schema. | +| `dropCursor` | `Object` | `{}` | Config for `prosemirror-dropcursor`. | +| `enableDropCursor` | `Boolean` | `true` | Option to enable / disable the dropCursor plugin. | +| `enableGapCursor` | `Boolean` | `true` | Option to enable / disable the gapCursor plugin. | +| `parseOptions` | `Object` | `{}` | A list of [Prosemirror parseOptions](https://prosemirror.net/docs/ref/#model.ParseOptions). | +| `onInit` | `Function` | `undefined` | This will return an Object with the current `state` and `view` of Prosemirror on init. | +| `onFocus` | `Function` | `undefined` | This will return an Object with the `event` and current `state` and `view` of Prosemirror on focus. | +| `onBlur` | `Function` | `undefined` | This will return an Object with the `event` and current `state` and `view` of Prosemirror on blur. | +| `onUpdate` | `Function` | `undefined` | This will return an Object with the current `state` of Prosemirror, a `getJSON()` and `getHTML()` function and the `transaction` on every change. | \ No newline at end of file diff --git a/docs/src/docPages/guide/configuration.md b/docs/src/docPages/guide/configuration.md index 972896ed..83ea9de0 100644 --- a/docs/src/docPages/guide/configuration.md +++ b/docs/src/docPages/guide/configuration.md @@ -8,18 +8,16 @@ See an example with `autoFocus: true` here: ```js import { Editor } from '@tiptap/core' -import extensions from '@tiptap/starter-kit' +import defaultExtensions from '@tiptap/starter-kit' new Editor({ element: document.getElementsByClassName('element'), - extensions: extensions(), + extensions: defaultExtensions(), content: '

Hey there!

', autoFocus: true, }) ``` -This will set the focus to tiptap after the editor is initialized. Of course, there are way more options available. Read about all of them in the related links. +This will set the focus to tiptap after the editor is initialized. Of course, there are way more options available. -### Related links - -* [See available options](#) +Check out the API documentation to see [all available options](/api/editor/). diff --git a/docs/src/docPages/overview/contributing.md b/docs/src/docPages/overview/contributing.md index 70951017..63c8e4e0 100644 --- a/docs/src/docPages/overview/contributing.md +++ b/docs/src/docPages/overview/contributing.md @@ -1,11 +1,20 @@ # Contributing +Tiptap would be nothing, without its lively community. Contributions have always been and will always be welcome. Here is a little bit you should know, before you send your contributions: + ## What kind of contributions are welcome -## What kind of contributions won’t be merged - -## How to send your first Pull Request +* Improved documentation, e. g. fixing typos, new sections, further explanation …) +* New features for existing extensions, e. g. a new option +* New extensions, which don’t require changes to the core or other core extensions +* Well explained, non-breaking changes to the core ## Code style -## Testing \ No newline at end of file +There is a eslint config, that ensures a consistent code style. To check for errors, run `$ yarn run lint`. That’ll be checked when you send a pull request. Make sure it’s passing, before sending a pull request. + +## Testing + +All your pull requests will automatically run all our existing tests. Make sure that they all pass. Run all tests locally with `$ yarn run test` or run single tests (e. g. when writing new ones) with `$ yarn run test:open`. + +Any further questions? Create a new issue or discussion in the repository. We’ll get back to you. diff --git a/docs/src/docPages/overview/roadmap.md b/docs/src/docPages/overview/roadmap.md deleted file mode 100644 index 55bfc8ce..00000000 --- a/docs/src/docPages/overview/roadmap.md +++ /dev/null @@ -1,3 +0,0 @@ -# Roadmap - -See https://github.com/ueberdosis/tiptap-next/projects/1 diff --git a/docs/src/docPages/overview/sponsoring.md b/docs/src/docPages/overview/sponsoring.md deleted file mode 100644 index 802fe27b..00000000 --- a/docs/src/docPages/overview/sponsoring.md +++ /dev/null @@ -1,3 +0,0 @@ -# Sponsoring - -https://github.com/sponsors/ueberdosis diff --git a/docs/src/docPages/overview/upgrade-guide.md b/docs/src/docPages/overview/upgrade-guide.md index 4697ac1e..665d294f 100644 --- a/docs/src/docPages/overview/upgrade-guide.md +++ b/docs/src/docPages/overview/upgrade-guide.md @@ -1,16 +1,16 @@ # Upgrade Guide -The new API will look pretty familiar too you, but there are a ton of changes though. To make the upgrade a little bit easier, here is everything you need to know: - ## Reasons to upgrade to tiptap 2.x -* TypeScript: auto complete, less bugs, generated API documentation -* Amazing documentation with 100+ pages -* Active maintenance, no more updates to 1.x -* Tons of new extensions planned -* Less bugs, tested code based +* autocomplete in your IDE (thanks to TypeScript) +* an amazing documentation with 100+ pages +* active development, new features in the making +* tons of new extensions planned +* well-tested code base ## Upgrading from 1.x to 2.x +The new API will look pretty familiar too you, but there are a ton of changes though. To make the upgrade a little bit easier, here is everything you need to know: + ### 1. Explicitly register the Document, Text and Paragraph extensions Tiptap 1 tried to hide a few required extensions from you. Be sure to explicitly import the [Document](/api/extensions/document), [Paragraph](/api/extensions/paragraph) and [Text](/api/extensions/text) extensions. @@ -55,3 +55,6 @@ const CustomExtension = … ### 4. Blockquotes must not be nested anymore +:::warning Breaking Change +Currently, blockquotes must not be nested anymore. That said, we’re working on bringing it back. If you use nested blockquotes in your app, don’t upgrade yet. +::: diff --git a/docs/src/layouts/App/index.vue b/docs/src/layouts/App/index.vue index ad6605b7..84b0e317 100644 --- a/docs/src/layouts/App/index.vue +++ b/docs/src/layouts/App/index.vue @@ -34,10 +34,6 @@
-