不废话,自定义快速自定义构建下载(如果只是普通的直接下载cdn)
https://ckeditor.com/ckeditor-5/online-builder/
选择编辑器类型 (一般基本就好)
下面选择需要的插件 比如 如果需要用来写博客之类的 就添加代码块(友情提示:不要翻译网站 不然会出bug哦)
选好之后下一步 将需要的插件点下去(用于插件显示)
选择默认语言
开始打包下载
打开sample/index.html 复制粘贴到项目中即可
什么?你说怎么跟网站上的api不一样 js中的配置太多?
因为没有webpack构建 如果没有前端知识就将就用吧 如果非要优化 好吧。那就前端的方式去构建吧。
首先 需要git、node
构建方式:
https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/installing-plugins.html
这样就可以不用再配置相关插件按钮了
ClassicEditor.create( document.querySelector( '#editor' ) )
.then( editor => {
window.editor = editor;
} )
.catch( error => {
console.error( 'There was a problem initializing the editor.', error );
} );
YY这么些,这些东西官网都有。 好吧,那就放点至少我没找到的---代码高亮
这个插件ckeditor5中没有,所以沿用ckeditor4中的高亮插件codesnippet
在 这里 搜索下载 ,将codesnippet文件拷贝出来,回显的时候进行引用就好,css样式根据自己爱好选。