Skip to content
hhhjinPublic

About

A headless rich-text editor framework for Rust with GPUI support

Topics

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

gpdoc

gpdoc is a headless rich-text editor framework for Rust with GPUI support. Use plugins to add tables, mentions, and task lists.

Open a GPUI window with the paragraph and bold plugins.

use gpdoc::{DocumentSource, EditorConfig};
use gpdoc_plugin_bold::bold;
use gpdoc_plugin_paragraph::paragraph;
use gpui::{Application, WindowOptions};

fn main() {
    Application::new().run(|cx| {
        let config = EditorConfig::builder()
            .plugin(paragraph()).plugin(bold())
            .build()
            .expect("configure editor");

        cx.open_window(WindowOptions::default(), |_, cx| {
            config.open(DocumentSource::Empty, cx).expect("open editor")
        })
        .expect("open editor window");
    });
}

Click the editor, type and select some text, then press Command+B on macOS or Ctrl+B on Linux to make it bold.

With the matching plugins, gpdoc can read and write ProseMirror and Tiptap document JSON.

Write a plugin · MIT license

About

A headless rich-text editor framework for Rust with GPUI support

Topics

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages