ehaerer / rte-ckeditor-codesnippet
集成了 CKEditor 代码片段插件
1.0.1
2022-05-01 15:28 UTC
Requires
- php: >=7.2.0
- typo3/cms-core: ^9.5 || ^10.4 || ^11.5
- typo3/cms-rte-ckeditor: ^9.5 || ^10.4 || ^11.5
Suggests
Replaces
- typo3-ter/rte-ckeditor-codesnippet: 1.0.1
README
此扩展包含一个简单的 CkEditor 插件,允许编辑器在文本元素中插入代码标签。该插件本身是从 CKEditor 插入代码片段文档 中获取的,未做任何修改。
目前它集成了 插件版本 4.18.0。
建议使用 fs_code_snippet 扩展来渲染网站前端的代码片段。
简要概述
安装
使用 composer require ehaerer/rte-ckeditor-codesnippet
或从 TER 下载扩展。
该扩展需要从 TER 或通过 Composer 安装 fs_code_snippet 扩展,它将自动安装。fs_code_snippet 用于在前端渲染输出。
用法
要启用插件,只需在您的 RTE.yaml
中进行以下更改,例如包括所需的 TsConfig 和可选地包括 fs_code_snippet 的 TypoScript 配置。
- 从扩展中导入配置到您的 RTE 配置
imports: - { resource: "EXT:rte_ckeditor_codesnippet/Configuration/RTE/Plugin.yaml" }
- 在您的 RTE 配置中启用插件
editor: config: extraPlugins: - codesnippet
- 可选:在网站包的配置中包含 fs_code_snippet 的 TypoScript 常量和设置,以在网站(前端)中渲染代码块
# constants
@import 'EXT:fs_code_snippet/Configuration/TypoScript/constants.txt'
# setup
@import 'EXT:fs_code_snippet/Configuration/TypoScript/setup.txt'
- 在后台编辑器和网站的前端检查结果。