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 app;
13pub use app::AppExt;
14
15mod anchor;
16mod block_menu;
17mod document;
18mod editor;
19mod handles;
20mod history;
21mod layout;
22mod link;
23mod mention;
24mod paste;
25mod slash;
26mod text_size;
27
28pub use anchor::{Anchor, AnchorId, SourceAnchor, SourceRanges};
29pub use block_menu::defaults as block_menu_defaults;
30pub use document::{Document, DocumentEvent};
31#[doc(hidden)]
32pub use editor::menu::{BLOCK_HANDLE, BLOCK_MENU, SLASH_MENU};
33pub use editor::{
34    CONTEXT, Chrome, Editor, EditorEvent, Formatting, HIGHLIGHT_MARK, Mode,
35    image::{ImageStore, Source},
36    init, keys, quotes, turns,
37};
38pub use handles::Handles;
39pub use history::{DEFAULT_UNDO_LIMIT, EditKind, History, Run, Step};
40pub use layout::Layout;
41pub use mention::{Mention, MentionSource};
42pub use paste::{PasteContent, PasteContext, PasteHandler};
43pub use slash::{SlashAction, SlashAt, SlashItem, SlashRow, SlashRun, defaults as slash_defaults};
44pub use text_size::TextSize;