Skip to content

Commit 94d79a8

Browse files
committed
2.x
1 parent 75ea341 commit 94d79a8

File tree

5 files changed

+35
-6142
lines changed

5 files changed

+35
-6142
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
All notable changes to `filament-syntax-entry` will be documented in this file.
44

5+
## 2.0.0 - March 26, 2024
6+
7+
- Syntax highlighting now handled server-side using [tempestphp/highlight](https://github.com/tempestphp/highlight)
8+
- Highlight.js theme support dropped
9+
- Added documentation on how to create custom themes
10+
- Added support for Laravel 11
11+
- PHP 8.3 required for server-side highlighting
12+
513
## 1.0.1 - Feb 2, 2024
614

715
- General codebase housekeeping

README.md

Lines changed: 25 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Total Downloads](https://img.shields.io/packagist/dt/parallax/filament-syntax-entry?style=flat-square)](https://packagist.org/packages/parallax/filament-syntax-entry)
66
![Stars](https://img.shields.io/github/stars/parallax/filament-syntax-entry?style=flat-square)
77

8-
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).
99

1010
<img class="filament-hidden" src="https://github.com/parallax/filament-syntax-entry/raw/main/assets/filament-syntax-entry.jpg"/>
1111

@@ -23,6 +23,14 @@ Optionally, you can publish the views using
2323
php artisan vendor:publish --tag="filament-syntax-entry-views"
2424
```
2525

26+
## Upgrading from 1.x
27+
28+
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+
2634
## Quickstart
2735

2836
### Add the [Infolist entry](https://filamentphp.com/docs/3.x/infolists/entries/getting-started)
@@ -50,116 +58,43 @@ class ProductResource extends Resource
5058

5159
### Setting the language
5260

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:
5462

5563
```php
5664
SyntaxEntry::make('metadata')
5765
->language('json');
5866
```
5967

60-
To keep the bundle size down only the following languages are currently available:
68+
The following languages are currently available:
6169

62-
- `bash`
70+
- `blade`
6371
- `css`
64-
- `dockerfile`
65-
- `graphql`
72+
- `gdscript`
73+
- `html`
6674
- `javascript`
6775
- `json`
68-
- `markdown`
6976
- `php`
70-
- `scss`
71-
- `shell`
7277
- `sql`
73-
- `typescript`
78+
- `twig`
7479
- `xml`
7580
- `yaml`
7681

77-
### Setting the theme
82+
### Creating a custom theme
7883

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:
8085

8186
```php
8287
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
8595
```
8696

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).
16398

16499
## Changelog
165100

resources/css/index.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@import '../../vendor/filament/filament/resources/css/theme.css';
2-
31
.syntax-entry-component .grid {
42
@apply grid-cols-1;
53
}

0 commit comments

Comments
 (0)