Skip to main content

Module widget

Module widget 

Source
Expand description

The public widget API.

  • EditorState owns the document, selection, history, paper, zoom, tab width, highlighter, image settings and style. Keep it in your application state.

  • markdown_editor builds the widget from a &EditorState.

  • The widget produces Actions. Pass them to EditorState::update, which returns an Output with a Task and the Events that happened.

  • EditorState::execute runs a Command programmatically.

  • edit: keyboard, mouse and commands.

  • source: Markdown source mode.

  • view: the widget (page canvas, link bar, status bar).

  • toolbar: the built-in toolbar.

  • menu: the context menu (right mouse button).

  • dialog: the link dialog opened from the context menu.

Structs§

Action
A message produced by the widget. Opaque: forward it to EditorState::update. Create one from a Command with Action::from(command) to drive the editor from your own widgets.
EditorState
The editor state. Keep one per editor in your application.
Formatting
Formatting at the caret, for building custom toolbars.
MarkdownEditor
Builder returned by markdown_editor.
Output
Result of EditorState::update.

Enums§

Command
Operations that can be triggered programmatically.
Event
Something that happened inside the editor.
Mode
Editing mode.

Constants§

DEFAULT_TAB_WIDTH
Default number of spaces inserted by the Tab key.

Functions§

markdown_editor
Creates the editor widget for the given state.