on-codemerge
zero dependencies editor
Docs
Description
This text editor is a modular system that allows for extending functionality through plugins. The editor supports basic text editing features such as undo and redo, and it enables inserting and editing links and videos.
Installation
To use the editor, include it in your project by importing the main EditorCore class and any required plugins.
import { EditorCore } from 'on-codemerge';
import BoldButtonPlugin from 'on-codemerge/boldbuttonplugin';
Setup
Initialize the editor by creating an instance of EditorCore
and passing the target DOM element where the editor should be rendered.
const targetElement = document.getElementById('editor');
const editor = new EditorCore(targetElement);
editor.registerModule(new BoldButtonPlugin());
editor.init();
Using Plugins
Plugins can be added to enhance the functionality of the editor. Here's an example of how to add a bold button plugin.
import BoldButtonPlugin from 'path/to/boldbuttonplugin';
editor.registerModule(new BoldButtonPlugin());
Contribution
Contributions to the editor are welcome. Please ensure that custom plugins and features adhere to the project's architecture and coding standards.
For more detailed documentation, please refer to the individual plugin files and the source code of EditorCore
.