Skip to content

Commit

Permalink
feat(docs): added cdn installation guide (#4045)
Browse files Browse the repository at this point in the history
* Update cdn.md

Added 3 examples of CDN usage.

* Update installation.md

Uncommented CDN line

* Update cdn.md

removed Skypack -- not reliable in testing with Codepen.

* Update cdn.md

removed esm.run. I couldn't solve the issue.
  • Loading branch information
RicoTrevisan committed Jul 7, 2023
1 parent 87b83e3 commit 8536508
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/installation.md
Expand Up @@ -19,7 +19,7 @@ Tiptap is framework-agnostic and even works with Vanilla JavaScript (if that’s
- [Svelte](/installation/svelte)
- [Alpine.js](/installation/alpine)
- [PHP](/installation/php)
<!-- [CDN](/installation/cdn)-->
- [CDN](/installation/cdn)

### Community efforts

Expand Down
16 changes: 10 additions & 6 deletions docs/installation/cdn.md
@@ -1,9 +1,9 @@
# 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:
It's also possible to run Tiptap directly on the browser by using CDNs like [esm.sh](https://esm.sh).
(Unfortunately [Skypack](https://skypack.dev) has not been reliable in our testing).

## ESM.SH

```html
<!DOCTYPE html>
Expand All @@ -14,8 +14,8 @@ For testing purposes or demos, use our [Skypack](https://www.skypack.dev/) CDN b
<body>
<div class="element"></div>
<script type="module">
import { Editor } from 'https://cdn.skypack.dev/@tiptap/core?min'
import StarterKit from 'https://cdn.skypack.dev/@tiptap/starter-kit?min'
import { Editor } from 'https://esm.sh/@tiptap/core'
import StarterKit from 'https://esm.sh/@tiptap/starter-kit'
const editor = new Editor({
element: document.querySelector('.element'),
extensions: [
Expand All @@ -28,4 +28,8 @@ For testing purposes or demos, use our [Skypack](https://www.skypack.dev/) CDN b
</html>
```


---

You should now see Tiptap in your browser. Time to give yourself a pat on the back! :)

0 comments on commit 8536508

Please sign in to comment.