torchlight/torchlight-laravel
Composer 安装命令:
composer require torchlight/torchlight-laravel
包简介
A Laravel Client for Torchlight, the syntax highlighting API.
README 文档
README
A Torchlight syntax highlighting extension for the Laravel framework.
Torchlight is a VS Code-compatible syntax highlighter that requires no JavaScript, supports every language, every VS Code theme, line highlighting, git diffing, and more.
Installation
To install, require the package from composer:
composer require torchlight/torchlight-laravel
Configuration
Once the package is downloaded, you can run the following command to publish your configuration file:
php artisan torchlight:install
Once run, you should see a new file torchlight.php in you config folder, with contents that look like this:
<?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'), ];
Cache
Set the cache driver that Torchlight will use.
Theme
You can change the theme of all your code blocks by adjusting the theme key in your configuration.
Token
This is your API token from torchlight.dev. (Torchlight is completely free for personal and open source projects.)
Blade Components
By default Torchlight works by using a custom Laravel component. If you'd like to disable the registration of the component for whatever reason, you can turn this to false.
Host
You can change the host where your API requests are sent. Not sure why you'd ever want to do that, but you can!
torchlight/torchlight-laravel 适用场景与选型建议
torchlight/torchlight-laravel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 489.73k 次下载、GitHub Stars 达 120, 最近一次更新时间为 2021 年 05 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「syntax highlighting」 「Code highlighting」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 torchlight/torchlight-laravel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 torchlight/torchlight-laravel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 torchlight/torchlight-laravel 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Bookdown.io With Bootswatch Styles And Prism Syntax Highlighting
CakePHP plugin for markup (parsing and displaying)
Code highlighter for various programming, markup and configuration languages based on PrismJS
Lightweight, robust, elegant syntax highlighting content element based on PrismJS
Adds a new field type that provides syntax highlighting capabilities using PrismJS.
CakePHP plugin that integrates with Geshi Syntax highlighter.
统计信息
- 总下载量: 489.73k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 120
- 点击次数: 21
- 依赖项目数: 15
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-05-23