diff --git a/docs/package.json b/docs/package.json index 2d8beafe..317e7d13 100644 --- a/docs/package.json +++ b/docs/package.json @@ -27,6 +27,7 @@ "vue-live": "^1.15.1", "y-indexeddb": "^9.0.5", "y-webrtc": "^10.1.6", + "y-websocket": "^1.3.6", "yjs": "^13.4.4" }, "devDependencies": { diff --git a/docs/src/demos/Examples/CollaborativeEditingWs/index.spec.js b/docs/src/demos/Examples/CollaborativeEditingWs/index.spec.js new file mode 100644 index 00000000..3d46c471 --- /dev/null +++ b/docs/src/demos/Examples/CollaborativeEditingWs/index.spec.js @@ -0,0 +1,5 @@ +context('/examples/collaborative-editing-ws', () => { + before(() => { + cy.visit('/examples/collaborative-editing-ws') + }) +}) diff --git a/docs/src/demos/Examples/CollaborativeEditingWs/index.vue b/docs/src/demos/Examples/CollaborativeEditingWs/index.vue new file mode 100644 index 00000000..acedbb82 --- /dev/null +++ b/docs/src/demos/Examples/CollaborativeEditingWs/index.vue @@ -0,0 +1,331 @@ + + + + + diff --git a/docs/src/docPages/api/nodes/blockquote.md b/docs/src/docPages/api/nodes/blockquote.md index 66de2089..7a58e85d 100644 --- a/docs/src/docPages/api/nodes/blockquote.md +++ b/docs/src/docPages/api/nodes/blockquote.md @@ -1,6 +1,6 @@ # Blockquote -The Blockquote extension enables you to use the `
` HTML tag in the editor. This is great – you might have guessed – to use quotes in the editor. +The Blockquote extension enables you to use the `
` HTML tag in the editor. This is great to use quotes in the editor. Type at the beginning of a new line and it will magically transform to a blockquote. diff --git a/docs/src/docPages/api/overview.md b/docs/src/docPages/api/overview.md index 46b551c6..506219fd 100644 --- a/docs/src/docPages/api/overview.md +++ b/docs/src/docPages/api/overview.md @@ -1,5 +1,5 @@ # Overview -tiptap is a friendly wrapper around [ProseMirror](https://ProseMirror.net). +tiptap is a friendly wrapper around [ProseMirror](https://ProseMirror.net). Although tiptap tries to hide most of the complexity of ProseMirror, it’s built on top of its APIs and we recommend you to read through the [ProseMirror Guide](https://ProseMirror.net/docs/guide/) for advanced usage. ### Structure ProseMirror works with a strict [Schema](/api/schema), which defines the allowed structure of a document. A document is a tree of headings, paragraphs and others elements, so called nodes. Marks can be attached to a node, e. g. to emphasize part of it. [Commands](/api/commands) change that document programmatically. @@ -9,5 +9,3 @@ The document is stored in a state. All changes are applied as transactions to th ### Extensions Extensions add [nodes](/api/nodes), [marks](/api/marks) and/or [functionalities](/api/extensions) to the editor. A lot of those extensions bound their commands to common [keyboard shortcuts](/api/keyboard-shortcuts). - -All those concepts are explained in detail on the following pages. diff --git a/docs/src/docPages/examples/collaborative-editing-ws.md b/docs/src/docPages/examples/collaborative-editing-ws.md new file mode 100644 index 00000000..fd0ffe4a --- /dev/null +++ b/docs/src/docPages/examples/collaborative-editing-ws.md @@ -0,0 +1,5 @@ +# Collaborative editing + +Websockets + + diff --git a/docs/src/docPages/guide/get-started.md b/docs/src/docPages/guide/get-started.md new file mode 100644 index 00000000..99e4603b --- /dev/null +++ b/docs/src/docPages/guide/get-started.md @@ -0,0 +1,81 @@ +# Get started + +## toc + +## Introduction +tiptap 2 is framework-agnostic and even works with plain JavaScript, if that’s your thing. As the previous major version required Vue.js, we decided to focus on Vue.js in the first version of this guide. That said, it’s probably also helpful for developers who work with different technologies. + +Let’s take a few basic building blocks for a test drive. + +## Requirements +The following guide assumes you’re working with Vue.js. Hopefully, that helps to get you going with other frameworks (or without a framework at all), while we’re working on more guides. We also assume you’ve [set up Node.js](https://nodejs.org/en/download/) on your machine already. + +## 1. Create a new project + +### Install Vue CLI (optional) +```bash +# with npm +npm install -g @vue/cli +# with Yarn +yarn global add @vue/cli +``` + +Let’s start with a fresh Vue.js project. If you already have an existing Vue.js project, that’s fine too. Just skip this first step and proceed with the next step. + +### Create a project (optional) +Pick *Default ([Vue 2] babel, eslint)* + +```bash +# create a project +vue create tiptap-example + +# change directory +cd tiptap-example +``` + +### Install the dependencies +You can install tiptap for Vue.js as a dependency in your project: + +```bash +# install the Vue.js adapter with npm +npm install @tiptap/core @tiptap/vue-starter-kit + +# or: install the Vue.js adapter with Yarn +yarn add @tiptap/core @tiptap/vue-starter-kit +``` + +The `@tiptap/vue-starter-kit` includes a few basics you would probably need anyway. Cool, you have got everything in place to start fiddling around with tiptap! 🙌 + +Start your project with `$ yarn serve` or `$ npm run serve`. Open [http://localhost:8080/](http://localhost:8080/) in your favorite browser. + +## 2. Create a new component +Create a new Vue component (you can call it ``) and add the following content. This is the fastest way to get tiptap up and running with Vue.js. It will give you a very basic version of tiptap, without any buttons. No worries, you will be able to add more functionality soon. + + + +## 3. Add it to your app + +```js + + + +``` + +::: warning Nuxt.js +If you use Nuxt.js, note that tiptap needs to run in the client, not on the server. It’s required to wrap the editor in a `` tag. +::: + +Congrats! You’ve got it! 🎉 Let’s start to configure your editor in the next step. diff --git a/docs/src/docPages/guide/getting-started.md b/docs/src/docPages/guide/getting-started.md deleted file mode 100644 index 2ebbd29f..00000000 --- a/docs/src/docPages/guide/getting-started.md +++ /dev/null @@ -1,30 +0,0 @@ -# Getting started - -## toc - -## Introduction -tiptap is framework-agnostic and works with Vue.js and React. It even works with plain JavaScript, if that’s your thing. To keep everything as small as possible, we put the code to use tiptap with those frameworks in different packages. - -## 1. Install the dependencies -We assume you already have a [Vue.js](https://cli.vuejs.org/) (or [Nuxt.js](https://nuxtjs.org/)) project. To connect tiptap with Vue.js you are going to need an adapter. You can install tiptap for Vue.js as a dependency in your project: - -```bash -# Install the Vue.js adapter with npm -npm install @tiptap/vue @tiptap/vue-starter-kit - -# Or: Install the Vue.js adapter with Yarn -yarn add @tiptap/vue @tiptap/vue-starter-kit -``` - -The `@tiptap/vue-starter-kit` includes a few basics you would probably need anyway. Cool, you have got everything in place to set up tiptap! 🙌 - -## 2. Create a new component -Create a new Vue component (you can call it ``) and add the following content. This is the fastest way to get tiptap up and running with Vue.js. It will give you a very basic version of tiptap, without any buttons. No worries, you will be able to add more functionality soon. - - - -::: warning Nuxt.js -If you use Nuxt.js, note that tiptap needs to run in the client, not on the server. It’s required to wrap the editor in a `` tag. -::: - -Congrats! You’ve got it! 🎉 Let’s start to configure your editor in the next step. diff --git a/docs/src/docPages/introduction.md b/docs/src/docPages/introduction.md index 333857a8..ef415063 100644 --- a/docs/src/docPages/introduction.md +++ b/docs/src/docPages/introduction.md @@ -7,20 +7,18 @@ Nothing here is production-ready, don’t use it anywhere. ::: # Introduction - - - - +[![Version](https://img.shields.io/npm/v/@tiptap/core.svg?label=version)](https://www.npmjs.com/package/@tiptap/core) +[![Downloads](https://img.shields.io/npm/dm/@tiptap/core.svg)](https://npmcharts.com/compare/@tiptap/core?minimal=true) +[![License](https://img.shields.io/npm/l/@tiptap/core.svg)](https://www.npmjs.com/package/@tiptap/core) [![Sponsor](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub)](https://github.com/sponsors/ueberdosis) -tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich-text WYSIWYG editors, which is already in use at many well-known companies such as *New York Times*, *The Guardian* or *Atlassian*. +tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as *New York Times*, *The Guardian* or *Atlassian*. -Although tiptap tries to hide most of the complexity of ProseMirror, it’s built on top of its APIs and we recommend you to read through the [ProseMirror Guide](https://ProseMirror.net/docs/guide/) for advanced usage. You’ll have a better understanding of how everything works under the hood and get more familiar with many terms and jargon used by tiptap. +Create exactly the rich text editor you want out of modular, and customizable building blocks. Tiptap comes with sensible defaults, many default extensions and a friendly API. It’s open source, free, and backed by a welcoming community. ## Features - **Headless.** We don’t tell you what a menu should look like or where it should be rendered in the DOM. That’s why tiptap is headless and comes without any CSS. You are in full control over markup and styling. **Framework-agnostic.** We don’t care what framework you use. tiptap is ready to be used with plain JavaScript or Vue.js. That makes it even possible to write a renderer for React, Svelte and others. @@ -34,6 +32,8 @@ Although tiptap tries to hide most of the complexity of ProseMirror, it’s buil - [ApostropheCMS](https://apostrophecms.com) - [Directus CMS](https://directus.io) - [Nextcloud](https://apps.nextcloud.com/apps/text) +- [DocIQ](https://www.dociq.io) +- [Scrumpy](https://www.scrumpy.io) - [and many more →](https://github.com/ueberdosis/tiptap/network/dependents?package_id=UGFja2FnZS0xMzE5OTg0ODc%3D) ## License diff --git a/docs/src/docPages/privacy-policy.md b/docs/src/docPages/privacy-policy.md index 1c19fad6..1e51f4a4 100644 --- a/docs/src/docPages/privacy-policy.md +++ b/docs/src/docPages/privacy-policy.md @@ -11,14 +11,21 @@ We don’t provide email support for tiptap, but if you have some legal issues, ## List of external services -### GitHub +### Community (GitHub) We use [GitHub](http://github.com/) to store our code, collaborate, give support, and offer sponsorships. Check their [privacy statement](https://docs.github.com/en/free-pro-team@latest/github/site-policy/github-privacy-statement) to learn more about what data they process. -### Netlify +### Hosting (Netlify) We use Netlify to host the documentation. It features continuous deployment from Git across a global application delivery network and full integration with Let’s Encrypt. If you want to know more, [read Netlify’s privacy policy](https://www.netlify.com/privacy/). -### Simple Analytics +### Tracking (Simple Analytics) We use [Simple Analytics](https://simpleanalytics.com/) to gain insight about our visitors in general. It doesn’t track individual users per se and does not store any personal identifiable information. Go to their documentation to find out what Simple Analytics collects (and more importantly what they don’t). Or have a look at the [public analytics dashboard](https://simpleanalytics.com/tiptap.dev) they provide. It’s not a stripped down version, it’s the exact same dashboard we use to check the traffic. +### Search (Algolia) +We use [Algolia DocSearch](https://docsearch.algolia.com/) to offer search functionality for the documentation. They crawl the same pages as you see once every day. If you click on the search field on top of this page, their search interface pops up. + +If you want to know more about what data they collect and process, [read their privacy policy](https://www.algolia.com/policies/privacy/). + +## Suggesting alternatives +If you know a good self-hosted version of any of the mentioned services, create an issue on GitHub or send us an email to [humans@tiptap.dev](mailto:humans@tiptap.dev). diff --git a/docs/src/links.yaml b/docs/src/links.yaml index 0fffe82d..1522c185 100644 --- a/docs/src/links.yaml +++ b/docs/src/links.yaml @@ -16,6 +16,10 @@ link: /examples/basic - title: Collaborative editing link: /examples/collaborative-editing + pro: true + - title: Collaborative editing (WS) + link: /examples/collaborative-editing-ws + draft: true - title: Markdown shortcuts link: /examples/markdown-shortcuts - title: Formatting @@ -37,30 +41,30 @@ - title: Guide items: - - title: Getting started - link: /guide/getting-started + - title: Get started + link: /guide/get-started draft: true - - title: Configuration + - title: Configure the editor link: /guide/configuration draft: true - - title: Create your editor + - title: Create a new toolbar link: /guide/create-your-editor draft: true - - title: Custom styling + - title: Add custom styling link: /guide/custom-styling - title: Store content link: /guide/store-content - title: Build custom extensions link: /guide/build-custom-extensions - - title: Collaborative editing - link: /guide/collaborative-editing - draft: true - pro: true - title: Advanced node views link: /guide/advanced-node-views draft: true - title: Working with TypeScript link: /guide/working-with-typescript + - title: Collaborative editing + link: /guide/collaborative-editing + draft: true + pro: true - title: API items: diff --git a/docs/src/static/_redirects b/docs/src/static/_redirects new file mode 100644 index 00000000..1138e57d --- /dev/null +++ b/docs/src/static/_redirects @@ -0,0 +1,4 @@ +/overview / +/examples /examples/basic +/guide /guide/get-started +/api /api/overview