You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Download](https://api.github.com/repos/bogdancondorachi/kirby-code-highlighter/zipball) and extract to: `/site/plugins/code-highlighter`
30
+
[Download the plugin](https://api.github.com/repos/bogdancondorachi/kirby-code-highlighter/zipball) and extract it to: `/site/plugins/code-highlighter`
33
31
34
32
## ⚙️ Usage
35
33
36
34
### Kirby Blocks Field
37
-
38
-
This plugin seamlessly integrates with Kirby's native [`code` block](https://getkirby.com/docs/reference/panel/blocks/code) replacing its default behavior:
35
+
This plugin overwrites the Kirby's native [`code` block](https://getkirby.com/docs/reference/panel/blocks/code), the output will be highlighted automatically.
39
36
40
37
```yaml
41
38
blocks:
42
39
type: blocks
43
40
fieldsets:
44
41
- code
45
42
```
46
-
*By default, the code block uses the default theme, but a theme selector is available if you wish to apply different themes to individual blocks. You can also customize the available language and theme options through the configuration settings.*
43
+
*By default, the code block uses the [default theme](#default-theme), but a theme selector is available if you wish to apply different themes to individual blocks. You can also [customize](#custom-languages-and-themes-for-code-blocks) the available language and theme options.*
47
44
48
45
### KirbyText
49
46
Embed syntax-highlighted code directly in KirbyText fields:
50
47
51
-
<pre lang="no-highlight"><code>```php
48
+
````
49
+
```php
52
50
echo "Hello, world!";
53
51
```
54
-
</code></pre>
52
+
````
55
53
56
54
Or use the plugin's custom KirbyTag with support for base64-encoded content:
*By default, the code tag applies the default theme. However, you can use the theme attribute to specify a different `theme` for individual code blocks.*
59
+
*By default, the code tag applies the default theme. However, you can use the theme attribute to specify a different theme for individual code blocks.*
62
60
63
61
## 🔧 Configuration
64
-
These options allow you to customize themes, language support, line numbering, and block behavior. All options are defined in your `config.php` file.
62
+
All options go into your `config.php` file:
65
63
66
64
### Default Theme
67
65
Set the default theme:
@@ -73,7 +71,7 @@ Set the default theme:
73
71
```
74
72
75
73
### Light/Dark Dual Themes
76
-
Set dual themes for light/dark mode:
74
+
Set the themes for light/dark mode:
77
75
78
76
```php
79
77
'bogdancondorachi.code-highlighter' => [
@@ -121,15 +119,15 @@ html.dark .phiki span {
121
119
```
122
120
123
121
### Line Numbering
124
-
Enable line numbers in your highlighted code blocks:
122
+
Enable line numbers in code blocks:
125
123
126
124
```php
127
125
'bogdancondorachi.code-highlighter' => [
128
126
'gutter' => true,
129
127
],
130
128
```
131
129
132
-
### Custom Languages and Themes for Code Blocks
130
+
### Customize Languages and Themes Selection
133
131
Customize the languages and themes available in Kirby’s code block:
0 commit comments