diff --git a/docs/api/utilities/tiptap-php.md b/docs/api/utilities/tiptap-php.md new file mode 100644 index 00000000..b8ac45ed --- /dev/null +++ b/docs/api/utilities/tiptap-php.md @@ -0,0 +1,29 @@ +# Tiptap for PHP +[![Latest Version on Packagist](https://img.shields.io/packagist/v/ueberdosis/tiptap-php.svg)](https://packagist.org/packages/ueberdosis/tiptap-php) +[![Total Downloads](https://img.shields.io/packagist/dt/ueberdosis/tiptap-php.svg)](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('

Example Text

') + ->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). + diff --git a/docs/installation.md b/docs/installation.md index d844c6e8..812902bf 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -5,10 +5,10 @@ tableOfContents: true # Installation ## 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 -* [CDN](/installation/cdn) + * [React](/installation/react) * [Next.js](/installation/nextjs) * [Vue 3](/installation/vue3) @@ -17,6 +17,7 @@ tiptap is framework-agnostic and even works with Vanilla JavaScript (if that’s * [Svelte](/installation/svelte) * [Alpine.js](/installation/alpine) * [Livewire](/installation/livewire) (Draft) +* [PHP](/installation/php) ### Community efforts * [Angular](https://github.com/sibiraj-s/ngx-tiptap) diff --git a/docs/installation/cdn.md b/docs/installation/cdn.md index f3dd54ff..163ce2b7 100644 --- a/docs/installation/cdn.md +++ b/docs/installation/cdn.md @@ -1,4 +1,8 @@ # 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: ```html diff --git a/docs/installation/livewire.md b/docs/installation/php.md similarity index 73% rename from docs/installation/livewire.md rename to docs/installation/php.md index d6c06815..803f9d2f 100644 --- a/docs/installation/livewire.md +++ b/docs/installation/php.md @@ -1,16 +1,18 @@ --- -title: Livewire WYSIWYG +title: PHP WYSIWYG tableOfContents: true --- - -# Livewire +# PHP ## 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