torchlight / laravel
v0.6.0
2024-05-16 18:16 UTC
Requires
- php: ^7.3|^8.0
- guzzlehttp/guzzle: ^7.2
- illuminate/cache: ^8.0|^9.0|^10.0|^11.0
- illuminate/console: ^8.0|^9.0|^10.0|^11.0
- illuminate/http: ^8.0|^9.0|^10.0|^11.0
- illuminate/support: ^8.0|^9.0|^10.0|^11.0
- illuminate/view: ^8.0|^9.0|^10.0|^11.0
- ramsey/uuid: ^3.7|^4.0
Requires (Dev)
- mockery/mockery: ^1.3.3
- orchestra/testbench: ^5.0|^6.0|^7.0|^9.0
- phpunit/phpunit: ^8.5.23|^9.5|^10.5
README
一个为Torchlight语法高亮的Laravel框架扩展。
Torchlight是一个与VS Code兼容的语法高亮器,无需JavaScript,支持所有语言,所有VS Code主题,行高亮,git diffing等功能。
安装
要安装,请从Composer中引入此包
composer require torchlight/torchlight-laravel
配置
下载包后,您可以运行以下命令发布您的配置文件
php artisan torchlight:install
运行后,您应该在您的config
文件夹中看到一个名为torchlight.php
的新文件,内容如下所示
<?php return [ // The Torchlight client caches highlighted code blocks. Here // you can define which cache driver you'd like to use. 'cache' => env('TORCHLIGHT_CACHE_DRIVER'), // Which theme you want to use. You can find all of the themes at // https://torchlight.dev/themes, or you can provide your own. 'theme' => env('TORCHLIGHT_THEME', 'material-theme-palenight'), // Your API token from torchlight.dev. 'token' => env('TORCHLIGHT_TOKEN'), // If you want to register the blade directives, set this to true. 'blade_components' => true, // The Host of the API. 'host' => env('TORCHLIGHT_HOST', 'https://api.torchlight.dev'), ];
缓存
设置Torchlight将使用的缓存驱动器。
主题
您可以通过调整配置中的theme
键来更改所有代码块的主题。
令牌
这是您从torchlight.dev获取的API令牌。(Torchlight对个人和开源项目完全免费。)
Blade组件
默认情况下,Torchlight通过使用自定义Laravel组件来工作。如果您出于任何原因想要禁用组件的注册,可以将此设置为false。
主机
您可以将API请求发送的主机地址更改。不确定您为何想这么做,但您可以做到!