The UI-independent core of a Word-style WYSIWYG CommonMark editor. It powers
iced-markdown-editor and
frust-markdown-editor.
The core holds the document model, Markdown import and export, layout and pagination, editing, selection, undo, source mode and tables. It depends on no UI framework and ships no fonts, icons or translations. Those belong to each editor.
- Create an
EditorCorewith theFontsthe UI draws with. - Turn framework events into
Inputs and pass them toEditorCore::update. - Carry out the returned
Effects and report theEvents. - Replay
EditorCore::content_scene, a list ofOps, onto the framework's canvas.
Effect and Op are exhaustive on purpose: a new variant is a compile error
in each editor rather than something silently ignored.
| Feature | Purpose |
|---|---|
syntect |
Ready-made syntax highlighter for code blocks |
images |
Decode images for display and paste them from the clipboard |
To work on the core and an editor together, check them out side by side and add
this to the editor's gitignored .cargo/config.toml:
[patch.crates-io]
markdown-editor-core = { path = "../markdown-editor-core" }MIT or Apache-2.0, at your option.