docs: add ueberdosis/tiptap-php
This commit is contained in:
29
docs/api/utilities/tiptap-php.md
Normal file
29
docs/api/utilities/tiptap-php.md
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# Tiptap for PHP
|
||||||
|
[](https://packagist.org/packages/ueberdosis/tiptap-php)
|
||||||
|
[](https://packagist.org/packages/ueberdosis/tiptap-php)
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
A PHP package to work with [Tiptap](https://tiptap.dev/) content. You can transform Tiptap-compatible JSON to HTML, and the other way around, sanitize your content, or just modify it.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
You can install the package via composer:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
composer require ueberdosis/tiptap-php
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
The PHP package mimics large parts of the JavaScript package. If you know your way around Tiptap, the PHP syntax will feel familiar to you. Here is an easy example:
|
||||||
|
|
||||||
|
```php
|
||||||
|
(new Tiptap\Editor)
|
||||||
|
->setContent('<p>Example Text</p>')
|
||||||
|
->getDocument();
|
||||||
|
|
||||||
|
// Returns:
|
||||||
|
// ['type' => 'doc', 'content' => …]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
There’s a lot more the PHP package can do. Check out the [repository on GitHub](https://github.com/ueberdosis/tiptap-php).
|
||||||
|
|
||||||
@@ -5,10 +5,10 @@ tableOfContents: true
|
|||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
tiptap is framework-agnostic and even works with Vanilla JavaScript (if that’s your thing). The following integration guides help you integrating Tiptap in your JavaScript project.
|
Tiptap is framework-agnostic and even works with Vanilla JavaScript (if that’s your thing). The following integration guides help you integrating Tiptap in your JavaScript project.
|
||||||
|
|
||||||
## Integration guides
|
## Integration guides
|
||||||
* [CDN](/installation/cdn)
|
<!-- * [CDN](/installation/cdn) -->
|
||||||
* [React](/installation/react)
|
* [React](/installation/react)
|
||||||
* [Next.js](/installation/nextjs)
|
* [Next.js](/installation/nextjs)
|
||||||
* [Vue 3](/installation/vue3)
|
* [Vue 3](/installation/vue3)
|
||||||
@@ -17,6 +17,7 @@ tiptap is framework-agnostic and even works with Vanilla JavaScript (if that’s
|
|||||||
* [Svelte](/installation/svelte)
|
* [Svelte](/installation/svelte)
|
||||||
* [Alpine.js](/installation/alpine)
|
* [Alpine.js](/installation/alpine)
|
||||||
* [Livewire](/installation/livewire) (Draft)
|
* [Livewire](/installation/livewire) (Draft)
|
||||||
|
* [PHP](/installation/php)
|
||||||
|
|
||||||
### Community efforts
|
### Community efforts
|
||||||
* [Angular](https://github.com/sibiraj-s/ngx-tiptap)
|
* [Angular](https://github.com/sibiraj-s/ngx-tiptap)
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
# CDN
|
# CDN
|
||||||
|
:::warning
|
||||||
|
There’s [an issue with skypack](https://github.com/skypackjs/skypack-cdn/issues/159), which causes trouble every now and then. We can’t do much about that for now.
|
||||||
|
:::
|
||||||
|
|
||||||
For testing purposes or demos, use our [Skypack](https://www.skypack.dev/) CDN builds. Here are the few lines of code you need to get started:
|
For testing purposes or demos, use our [Skypack](https://www.skypack.dev/) CDN builds. Here are the few lines of code you need to get started:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
|
|||||||
@@ -1,16 +1,18 @@
|
|||||||
---
|
---
|
||||||
title: Livewire WYSIWYG
|
title: PHP WYSIWYG
|
||||||
tableOfContents: true
|
tableOfContents: true
|
||||||
---
|
---
|
||||||
|
# PHP
|
||||||
# Livewire
|
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
The following guide describes how to integrate Tiptap with your [Livewire](https://laravel-livewire.com/) project.
|
You can use Tiptap with Laravel, Livewire, Inertia.js, [Alpine.js](/installation/alpine), [Tailwind CSS](/guide/styling#with-tailwind-css), and even - yes you read that right - inside PHP.
|
||||||
|
|
||||||
TODO
|
## Tiptap for PHP
|
||||||
|
We provide [an official PHP package to work with Tiptap content](/api/utilities/tiptap-php). A PHP package to work with Tiptap content. You can transform Tiptap-compatible JSON to HTML, and the other way around, sanitize your content, or just modify it.
|
||||||
|
|
||||||
## editor.blade.php
|
## Laravel Livewire
|
||||||
|
|
||||||
|
### editor.blade.php
|
||||||
```html
|
```html
|
||||||
<!--
|
<!--
|
||||||
In your livewire component you could add an
|
In your livewire component you could add an
|
||||||
@@ -23,7 +25,7 @@ TODO
|
|||||||
></x-editor>
|
></x-editor>
|
||||||
```
|
```
|
||||||
|
|
||||||
## my-livewire-component.blade.php
|
### my-livewire-component.blade.php
|
||||||
```html
|
```html
|
||||||
<div
|
<div
|
||||||
x-data="setupEditor(
|
x-data="setupEditor(
|
||||||
@@ -37,7 +39,7 @@ TODO
|
|||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
## index.js
|
### index.js
|
||||||
```js
|
```js
|
||||||
import { Editor } from '@tiptap/core'
|
import { Editor } from '@tiptap/core'
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
@@ -15,9 +15,9 @@
|
|||||||
- title: Installation
|
- title: Installation
|
||||||
link: /installation
|
link: /installation
|
||||||
items:
|
items:
|
||||||
- title: CDN
|
# - title: CDN
|
||||||
link: /installation/cdn
|
# link: /installation/cdn
|
||||||
skip: true
|
# skip: true
|
||||||
- title: React
|
- title: React
|
||||||
link: /installation/react
|
link: /installation/react
|
||||||
skip: true
|
skip: true
|
||||||
@@ -42,10 +42,10 @@
|
|||||||
- title: Alpine.js
|
- title: Alpine.js
|
||||||
link: /installation/alpine
|
link: /installation/alpine
|
||||||
skip: true
|
skip: true
|
||||||
# - title: Livewire
|
- title: PHP
|
||||||
# link: /installation/livewire
|
link: /installation/php
|
||||||
# type: draft
|
type: new
|
||||||
# skip: true
|
skip: true
|
||||||
- title: Upgrade guide
|
- title: Upgrade guide
|
||||||
link: /overview/upgrade-guide
|
link: /overview/upgrade-guide
|
||||||
- title: Changelog
|
- title: Changelog
|
||||||
@@ -404,6 +404,9 @@
|
|||||||
link: /api/utilities/html
|
link: /api/utilities/html
|
||||||
- title: Suggestion
|
- title: Suggestion
|
||||||
link: /api/utilities/suggestion
|
link: /api/utilities/suggestion
|
||||||
|
- title: Tiptap for PHP
|
||||||
|
link: /api/utilities/tiptap-php
|
||||||
|
type: new
|
||||||
- title: Keyboard shortcuts
|
- title: Keyboard shortcuts
|
||||||
link: /api/keyboard-shortcuts
|
link: /api/keyboard-shortcuts
|
||||||
- title: Schema
|
- title: Schema
|
||||||
|
|||||||
Reference in New Issue
Block a user