From 096f3165ac3eb1a46a5f4228da6256ebd449906a Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 11 Aug 2023 17:23:16 +0200 Subject: [PATCH] Add the documentation for the CKEditor 5 API Closes #381 --- docs/javascript/components_ckeditor5.md | 87 +++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 docs/javascript/components_ckeditor5.md diff --git a/docs/javascript/components_ckeditor5.md b/docs/javascript/components_ckeditor5.md new file mode 100644 index 00000000..751cd770 --- /dev/null +++ b/docs/javascript/components_ckeditor5.md @@ -0,0 +1,87 @@ +# CKEditor 5 - JavaScript API + +WoltLab Suite 6.0 ships with a customized version of CKEditor 5 that is enriched by multiple plugins to integrate into the framework. +The editor can be accessed through an abstraction layer and event system to interact with basic functionality and to alter its initialization process. + +## The `Ckeditor` API + +The `WoltLabSuite/Core/Component/Ckeditor` API offers multiple helper methods to interface with CKEditor and to insert and extract content. +You can get access to the instance using the `getCkeditor()` and `getCkeditorById()` methods once the editor has been initialized. + +Please refer to the typings of this component to learn about its API methods. + +## The Event System for CKEditor 5 + +The event system of CKEditor 5 was designed for actions from within the editor but not to interface with the “outside world”. +In order to provide a deeper integration there is `WoltLabSuite/Core/Component/Ckeditor/Event` and its exported function `listenToCkeditor()`. + +`listenToCkeditor()` expects the source element of the editor which usually is the `