docs: add ueberdosis/tiptap-php

This commit is contained in:
Hans Pagel 2022-01-27 23:04:05 +01:00
parent d899141a1a
commit bd266000dc
5 changed files with 56 additions and 17 deletions

View File

@ -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('<p>Example Text</p>')
->getDocument();
// Returns:
// ['type' => 'doc', 'content' => …]
```
## Documentation
Theres a lot more the PHP package can do. Check out the [repository on GitHub](https://github.com/ueberdosis/tiptap-php).

View File

@ -5,10 +5,10 @@ tableOfContents: true
# Installation
## Introduction
tiptap is framework-agnostic and even works with Vanilla JavaScript (if thats 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 thats your thing). The following integration guides help you integrating Tiptap in your JavaScript project.
## Integration guides
* [CDN](/installation/cdn)
<!-- * [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 thats
* [Svelte](/installation/svelte)
* [Alpine.js](/installation/alpine)
* [Livewire](/installation/livewire) (Draft)
* [PHP](/installation/php)
### Community efforts
* [Angular](https://github.com/sibiraj-s/ngx-tiptap)

View File

@ -1,4 +1,8 @@
# CDN
:::warning
Theres [an issue with skypack](https://github.com/skypackjs/skypack-cdn/issues/159), which causes trouble every now and then. We cant 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

View File

@ -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
<!--
In your livewire component you could add an
@ -23,7 +25,7 @@ TODO
></x-editor>
```
## my-livewire-component.blade.php
### my-livewire-component.blade.php
```html
<div
x-data="setupEditor(
@ -37,7 +39,7 @@ TODO
</div>
```
## index.js
### index.js
```js
import { Editor } from '@tiptap/core'
import StarterKit from '@tiptap/starter-kit'

View File

@ -15,9 +15,9 @@
- title: Installation
link: /installation
items:
- title: CDN
link: /installation/cdn
skip: true
# - title: CDN
# link: /installation/cdn
# skip: true
- title: React
link: /installation/react
skip: true
@ -42,10 +42,10 @@
- title: Alpine.js
link: /installation/alpine
skip: true
# - title: Livewire
# link: /installation/livewire
# type: draft
# skip: true
- title: PHP
link: /installation/php
type: new
skip: true
- title: Upgrade guide
link: /overview/upgrade-guide
- title: Changelog
@ -404,6 +404,9 @@
link: /api/utilities/html
- title: Suggestion
link: /api/utilities/suggestion
- title: Tiptap for PHP
link: /api/utilities/tiptap-php
type: new
- title: Keyboard shortcuts
link: /api/keyboard-shortcuts
- title: Schema