webwizardsusa / rich-editor-plus-code
Code blocks for Rich Editor Plus: pick the language, line numbers and highlighted lines, coloured with Shiki while editing and Phiki when rendered.
Package info
github.com/webwizardsusa/rich-editor-plus-code
pkg:composer/webwizardsusa/rich-editor-plus-code
Requires
- php: ^8.3
- phiki/phiki: ^2.2
- spatie/laravel-package-tools: ^1.92
- webwizardsusa/filament-rich-editor-plus: ^0.2.0 || dev-main
Requires (Dev)
- orchestra/testbench: ^11.0
- pestphp/pest: ^5.2
- pestphp/pest-plugin-laravel: ^5.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Under active development. This package is still changing and may not be ready for production use yet. Until 1.0, a minor release can include breaking changes, so check the changelog before you upgrade.
Code blocks for Rich Editor Plus, with a language picker, line numbers and highlighted lines. The editor colours code with Shiki as you type, and rendered content is highlighted on the server with Phiki, so the colours match and the page that shows the content needs no JavaScript to highlight it. The plugin takes the place of the core code block, and content stored before keeps working.
Requires PHP 8.3+ and Rich Editor Plus 0.2+ (Filament 5).
composer require webwizardsusa/rich-editor-plus-code php artisan filament:assets
use Webwizardsusa\RichEditorPlusCode\CodeBlockPlugin; RichEditorPlus::make('content')->addPlugins([ CodeBlockPlugin::make()->defaultLanguage('php'), ]);
Render with the same plugin, and add the styles once to the layout that shows the content:
<x-rich-editor-plus-code::assets />
Documentation
The full documentation is in the docs folder.
About Us
This package is developed and maintained by WebWizardsUSA, a top rated web development agency on Upwork.
License
The MIT License (MIT). See LICENSE.md.