xlink-editor

JavaScript Xlink web text editor.

Usage no npm install needed!

<script type="module">
  import xlinkEditor from 'https://cdn.skypack.dev/xlink-editor';
</script>

README

xlink-editor

Getting Started

使用npm package

npm i xlink-editor

在网站上使用xlink-editor:

<div id="editor">
  <p>This is the editor content.</p>
</div>
<script src="./node_modules/xlink-editor/ckeditor.js"></script>
<script>
  CKEDITOR.replace( 'editor' );
</script>

CKEditor4有自己的插件加载系统,这是不兼容webpack打包的。加载ckedtor4的一个更好的方法是把它放到webpack构建之外,然后异步加载它。 CKEditor4加载所需的额外文件需引用线上或本地服务器上的路径。

使用cdn

从cdn加载xlink-editor脚本:

<div id="editor">
  <p>This is the editor content.</p>
</div>
<script src="https://cdn.jsdelivr.net/npm/xlink-editor@0.1.1/ckeditor.js"></script>
<script>
  CKEDITOR.replace( 'editor' );
</script>

使用Git submodule

当想把文件放在静态资源目录上访问时,项目使用git,并且希望集成xlink-editor, 建议将此仓库作为子模块submodule添加

git submodule add https://code.xlink.cn/frontend/awesome/xlink-editor-release.git <clone dir>