Skip to content

FabienHenon/elm-ckeditor5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

elm-ckeditor5

Elm wrapper for ckeditor 5.

It requires ckeditor5-webcomponent and thus webcomponent polyfills and ckeditor 5 in order to work

Install

$ elm install FabienHenon/elm-ckeditor5

Usage

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 ]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages