FabienHenon/elm-ckeditor5/1.0.1

NOTE: the latest version is 1.4.0

CKEditor

HTML Element

view : List (Attribute msg) -> List (Html msg) -> Html msg

Renders a CKEditor instance

view
    [ config defaultConfig
    , onCKEditorChange CKEditorChanged
    ]
    [ text "Initial text" ]

Attributes

config : Config -> Attribute msg

Add the specified configuration to the editor. This will reload the component

view
    [ config (defaultConfig |> withLanguage "fr") ]
    []
editor : String -> Attribute msg

Sets the registered editor build to use

See ckeditor5-webcomponent for more information

Events

onChange : (String -> msg) -> Attribute msg

Event fired when the CKEditor content changed. This event will not necessarily fire on every single input action.

type Msg
    = CKEditorChanged String


onCKEditorChange CKEditorChanged

Config

type Config

Configuration of CKEditor

Default CKEditor config

withCustom : String -> Value -> Config -> Config

Set any other configuration

defaultConfig
    |> withCustom "mediaEmbed" mediaEmbedEncoder

The name must be a valid configuration property name

withLanguage : String -> Config -> Config

Set the language to use in the configuration

defaultConfig
    |> withLanguage "fr"

See reference

withPlugins : List String -> Config -> Config

Set the plugins to use in the configuration

defaultConfig
    |> withPlugins [ "Bold", "Italic" ]

See reference

withPluginsRemoved : List String -> Config -> Config

Set the plugins that should not be loaded in the configuration

defaultConfig
    |> withPluginsRemoved [ "Bold", "Italic" ]

See reference

withToolbar : List String -> Config -> Config

Set the toolbar to use in the configuration

defaultConfig
    |> withToolbar [ "bold", "italic" ]

See reference