Search page titles, headings and text across the docs.

Rust crates

canvist

The canvist rich-text editor engine in one crate. Add canvist and reach the document model, the editing engine, the extensions, and the headless engine through its modules; layout, collaboration, and the design canvas are a feature away.

cargo add canvist

The default features, headless and starter-kit, are what a server, a script, or a test needs: load and export ProseMirror/TipTap JSON, HTML, Markdown, and plain text, and run typed commands against explicit selections.

use canvist::headless::Engine;
use canvist::headless::Format;
use canvist::headless::Position;

let engine = Engine::starter_kit();
let kit = engine.handles();
let mut doc = engine.parse(Format::Markdown, "Hello world")?;

doc.select_range(&Position::new([0], 6), &Position::new([0], 11))?;
doc.run(&kit.bold.toggle())?;

assert_eq!(doc.export(Format::Html), "<p>Hello <strong>world</strong></p>");
# Ok::<(), canvist::headless::HeadlessError>(())

Each module is the crate it names, so canvist::headless::Engine is canvist_headless::Engine and every crate’s documentation applies unchanged.

ModuleCrateFeature
canvist::modelcanvist_modelalways
canvist::corecanvist_corealways
canvist::extensionscanvist_extensionsalways; starter-kit, extras, full
canvist::headlesscanvist_headlessheadless; journal, ssr, headless-scene
canvist::collabcanvist_collabcollab
canvist::layoutcanvist_layoutlayout; parley for real font measurement
canvist::scenecanvist_scenecanvas
canvist::canvascanvist_canvascanvas
canvist::paintcanvist_paintpaint; png (CPU), gpu (vello on wgpu)
  • collab: Yjs collaboration. With headless, a document is a Yjs peer and a y-sync endpoint; with canvas, so is a scene.
  • ssr: server-side HTML and SVG, laid out exactly as the canvas editor paints them.
  • headless-scene: load, edit, and export canvas scenes as SVG and PNG on a server.

The desktop editor, canvist_desktop, is a separate crate: add it next to canvist.

Docs