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
Add a Filament [infolist entry](https://filamentphp.com/docs/3.x/infolists/entries/getting-started) for themeable syntax highlighting using [highlight.js](https://highlightjs.org).
8
+
Add a Filament [infolist entry](https://filamentphp.com/docs/3.x/infolists/entries/getting-started) for themeable server-side syntax highlighting using [tempestphp/highlight](https://github.com/tempestphp/highlight).
There are a couple of important changes to be aware of when upgrading to version 2.x:
29
+
30
+
- PHP 8.3 is required for server-side syntax highlighting
31
+
- Highlight.js is no longer supported
32
+
- Theme selection has been replaced with the ability to create custom themes
33
+
26
34
## Quickstart
27
35
28
36
### Add the [Infolist entry](https://filamentphp.com/docs/3.x/infolists/entries/getting-started)
@@ -50,116 +58,43 @@ class ProductResource extends Resource
50
58
51
59
### Setting the language
52
60
53
-
Automatic language detection is enabled by default so this isn't required, but if you would like to define the language used you may use the `language()` method:
61
+
The default language value is set to `json`. To override this value you may use the `language()` method:
54
62
55
63
```php
56
64
SyntaxEntry::make('metadata')
57
65
->language('json');
58
66
```
59
67
60
-
To keep the bundle size down only the following languages are currently available:
68
+
The following languages are currently available:
61
69
62
-
-`bash`
70
+
-`blade`
63
71
-`css`
64
-
-`dockerfile`
65
-
-`graphql`
72
+
-`gdscript`
73
+
-`html`
66
74
-`javascript`
67
75
-`json`
68
-
-`markdown`
69
76
-`php`
70
-
-`scss`
71
-
-`shell`
72
77
-`sql`
73
-
-`typescript`
78
+
-`twig`
74
79
-`xml`
75
80
-`yaml`
76
81
77
-
### Setting the theme
82
+
### Creating a custom theme
78
83
79
-
You may override the default themes using the `theme()`and/or `darkModeTheme()` methods:
84
+
You may override the default theme by using the `theme()`method:
80
85
81
86
```php
82
87
SyntaxEntry::make('metadata')
83
-
->theme('filament')
84
-
->darkModeTheme('filament-dark');
88
+
->theme('smudge');
89
+
```
90
+
91
+
This will wrap the syntax component with a custom class like so:
92
+
93
+
```
94
+
syntax-entry-theme-smudge
85
95
```
86
96
87
-
The following themes are currently available:
88
-
89
-
-`a11y-dark`
90
-
-`a11y-light`
91
-
-`agate`
92
-
-`an-old-hope`
93
-
-`androidstudio`
94
-
-`arduino-light`
95
-
-`arta`
96
-
-`ascetic`
97
-
-`atom-one-dark-reasonable`
98
-
-`atom-one-dark`
99
-
-`atom-one-light`
100
-
-`brown-paper`
101
-
-`codepen-embed`
102
-
-`color-brewer`
103
-
-`dark`
104
-
-`default`
105
-
-`devibeans`
106
-
-`docco`
107
-
-`far`
108
-
-`felipec`
109
-
-`filament-dark` (default dark mode theme)
110
-
-`filament` (default theme)
111
-
-`foundation`
112
-
-`github-dark-dimmed`
113
-
-`github-dark`
114
-
-`github`
115
-
-`gml`
116
-
-`googlecode`
117
-
-`gradient-dark`
118
-
-`gradient-light`
119
-
-`grayscale`
120
-
-`hybrid`
121
-
-`idea`
122
-
-`intellij-light`
123
-
-`ir-black`
124
-
-`isbl-editor-dark`
125
-
-`isbl-editor-light`
126
-
-`kimbie-dark`
127
-
-`kimbie-light`
128
-
-`lightfair`
129
-
-`lioshi`
130
-
-`magula`
131
-
-`mono-blue`
132
-
-`monokai-sublime`
133
-
-`monokai`
134
-
-`night-owl`
135
-
-`nnfx-dark`
136
-
-`nnfx-light`
137
-
-`nord`
138
-
-`obsidian`
139
-
-`panda-syntax-dark`
140
-
-`panda-syntax-light`
141
-
-`paraiso-dark`
142
-
-`paraiso-light`
143
-
-`pojoaque`
144
-
-`purebasic`
145
-
-`qtcreator-dark`
146
-
-`qtcreator-light`
147
-
-`rainbow`
148
-
-`routeros`
149
-
-`school-book`
150
-
-`shades-of-purple`
151
-
-`srcery`
152
-
-`stackoverflow-dark`
153
-
-`stackoverflow-light`
154
-
-`sunburst`
155
-
-`tokyo-night-dark`
156
-
-`tokyo-night-light`
157
-
-`tomorrow-night-blue`
158
-
-`tomorrow-night-bright`
159
-
-`vs`
160
-
-`vs2015`
161
-
-`xcode`
162
-
-`xt256`
97
+
The final step is to follow the [tempestphp/highlight](https://github.com/tempestphp/highlight) documentation on how to create your own theme, and use this in combination with [Filament themes](https://filamentphp.com/docs/3.x/panels/themes#creating-a-custom-theme).
0 commit comments