Skip to content

Commit 5125f30

Browse files
Add Statamic integration
1 parent 6c75e65 commit 5125f30

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

docs/docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
"group": "Integrations",
5252
"pages": [
5353
"commonmark",
54-
"laravel"
54+
"laravel",
55+
"statamic"
5556
]
5657
},
5758
{

docs/statamic.mdx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: Statamic
3+
description: Learn how to use Phiki in a Statamic application.
4+
keywords: ['statamic']
5+
---
6+
7+
If you have installed Phiki inside of a Statamic application, then you can use the CommonMark extension to highlight code blocks in your Markdown content.
8+
9+
You can enable the extension by registering it with Statamic's Markdown class inside the `boot` method of a service provider.
10+
11+
```php
12+
use Statamic\Facades\Markdown;
13+
use Phiki\Adapters\CommonMark\PhikiExtension;
14+
use Phiki\Theme\Theme;
15+
use Phiki\Phiki;
16+
17+
class AppServiceProvider extends ServiceProvider
18+
{
19+
public function boot(): void
20+
{
21+
Markdown::addExtension(fn () => new PhikiExtension(Theme::GithubLight, resolve(Phiki::class)));
22+
}
23+
}
24+
```
25+
26+
For more information on using the `PhikiExtension`, see the [CommonMark](/commonmark) documentation.
27+
28+
If you wish to customize Phiki further, you can also refer to the [Laravel](/laravel) documentation since Statamic is built on top of Laravel.

0 commit comments

Comments
 (0)