assertchris / laravel-highlight-web-component
A Laravel plugin with a custom Web Component for highlighting code, using tempest/highlight.
1.0.1
2024-05-04 09:39 UTC
Requires
- php: ^8.3
- illuminate/cache: ^9.0|^10.0|^11.0
- illuminate/http: ^9.0|^10.0|^11.0
- illuminate/support: ^9.0|^10.0|^11.0
- tempest/highlight: ^2.3
Requires (Dev)
- orchestra/testbench: ^9.0
README
This is a Laravel plugin which introduces a custom Web Component for highlighting code using tempest/highlight.
To get started:
composer require assertchris/laravel-highlight-web-component
Import and use the custom component:
import Component from '../../vendor/assertchris/laravel-highlight-web-component/src/component.js'; customElements.define('w-code', Component);
Use it in your templates:
<w-code lang="php"> print "hello world"; </w-code>
Warning
You must still have Axios in your Laravel project for this to work.
Configuration
You can view and customise the config by publishing the vendor config files:
php artisan vendor:publish --provider=AC\\LaravelHighlightWebComponent\\Provider