Elm wrapper for ckeditor 5.
It requires ckeditor5-webcomponent and thus webcomponent polyfills and ckeditor 5 in order to work
$ elm install FabienHenon/elm-ckeditor5
Please follow these instructions to initialize ckeditor if you want more information about using ckeditor.
First you have to use an existing editor build or create a new one and register it in your Javascript code.
index.js
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
import EditorManager from 'ckeditor5-webcomponent';
// We register the ClassicEditor under the name 'classic'
EditorManager.register('classic', ClassicEditor);
Then, you can use the editor in your elm code:
import CKEditor
type Msg
= OnChange String
view initialContent =
CKEditor.view
[ CKEditor.editor "classic"
, CKEditor.onChange OnChange
, CKEditor.config
(CKEditor.defaultConfig
|> CKEditor.withLanguage "fr"
)
]
[ text initialContent ]