Skip to main content

editor/
lib.rs

1//! A Notion-style block editor for gpui, over the `markdown` document model.
2//!
3//! ```ignore
4//! editor::init(cx);                       // once, at startup
5//! let editor = cx.new(|cx| editor::Editor::new("# Title", cx));
6//! ```
7//!
8//! `markdown` holds the document, its markdown wire form, and the painting —
9//! all of it testable without a window. What lives here is the half that needs
10//! one: focus, keys, the platform input handler, the mouse, undo, and the menus.
11
12mod comment;
13mod editor;
14mod history;
15mod layout;
16mod link;
17mod slash;
18mod text_size;
19
20pub use comment::{Anchor, CommentId};
21#[doc(hidden)]
22pub use editor::menu::{BLOCK_HANDLE, BLOCK_MENU, SLASH_MENU};
23pub use editor::{
24    CONTEXT, Chrome, Editor, EditorEvent, Formatting, Mode,
25    image::{ImageStore, Source, set_image_store},
26    init, keys, turns,
27};
28pub use history::{DEFAULT_UNDO_LIMIT, EditKind, History, Step};
29pub use layout::{Layout, set_layout};
30pub use text_size::{
31    TextSize, adjust_text_size, reset_text_size, set_text_size, text_size_adjustment,
32};