norman-huth / nova-prism-js
This package is abandoned and no longer maintained.
No replacement package was suggested.
Syntax Highlighting with Prism.js. A Laravel Nova detail field.
Fund package maintenance!
1.1.1
2023-02-21 17:30 UTC
Requires
- php: ^8.0
- laravel/nova: ^4.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
This repository is archived and no longer maintained.
If you offer, maintain, or know of an actively maintained alternative to this project, please contact me at maintainers@huth.it.
If the alternative references this repository as its source, inspiration, predecessor, or migration path, I may list it here so existing users can find a maintained replacement.
Nova Prism.js
A Nova detail field with Syntax Highlighter via Prism.js. Usable with Markdown or HTML.
Installation
composer require norman-huth/nova-prism-js
Usage
use NormanHuth\NovaPrismJs\PrismJs; //.. public function fields(NovaRequest $request): array { return [ //.. PrismJs::make(__('Content'), 'content'), //.. ] }
Options
Change Theme
Set the Prism theme for light and dark mode.
- Theme from prismjs.com:
default,coy,dark,funky,okaidia,solarizedlight,tomorrow,twilight - Theme from PrismJS/prism-themes:
a11y-dark,atom-dark,base16-ateliersulphurpool-light,cb,coldark-cold,coldark-dark,coy-without-shadows,darcula,dracula,duotone-dark,duotone-earth,duotone-forest,duotone-light,duotone-sea,duotone-space,ghcolors,gruvbox-dark,gruvbox-light,holi-theme,hopscotch,lucario,material-dark,material-light,material-oceanic,night-owl,nord,one-dark,one-light,pojoaque,shades-of-purple,solarized-dark-atom,synthwave84,vs,vsc-dark-plus,xonokai,z-touch
PrismJs::make(__('Content'), 'content') ->setTheme('tomorrow') ->setDarkTheme('twilight'),
Full Width
PrismJs::make(__('Content'), 'content')->fullWidth(),
Use HTML instead of Markdown
PrismJs::make(__('Content'), 'content')->disableMarkdown(),