SylvainJule / code-editor
为 Kirby 3 和 4 提供的代码编辑器字段
1.0.3
2024-03-06 18:19 UTC
Requires
This package is auto-updated.
Last update: 2024-09-06 19:23:49 UTC
README
为 Kirby 3 和 4 提供的代码编辑器字段。
概述
此插件完全免费,并遵循 MIT 许可协议发布。然而,如果您在商业项目中使用它,并希望帮助我维护,请考虑自愿捐赠或通过我的联盟链接购买您的许可。
1. 安装
下载并将此存储库复制到 /site/plugins/code-editor
或者,您可以使用 composer 安装它:composer require sylvainjule/code-editor
2. 设置
此字段在面板中添加一个代码编辑器
editor: label: My code editor type: code-editor
3. 选项
请注意,您可以使用一些自定义面板 CSS将默认高度设置为任何高度。首先,将 size 选项设置为任何字符串
size: custom-size
然后在您的 panel.css 中
.k-code-editor-input[data-size="custom-size"] { min-height: 15rem; }
3.1. 默认选项
您可以通过全局覆盖默认选项来替代逐字段设置。在您的 site/config/config.php
return [ 'sylvainjule.code-editor.language' => 'css', 'sylvainjule.code-editor.size' => 'small', 'sylvainjule.code-editor.lineNumbers' => true, 'sylvainjule.code-editor.tabSize' => 4, 'sylvainjule.code-editor.insertSpaces' => true, 'sylvainjule.code-editor.ignoreTabKey' => false, ];
4. 可用语言
目前支持的语言包括
cssjavascriptjsonlessphppythonrubyscssyaml
5. 许可证
MIT
6. 致谢
代码编辑器
