excali-mode: Excalidraw running natively inside Emacs

Emacs 32 adds a canvas image type whose pixels a dynamic module can write directly. excali-mode uses it to run Excalidraw inside Emacs: the scene model and every editing command are Elisp, and a small C module draws the scene with Cairo and Pango (ports of rough.js and perfect-freehand) straight into the canvas. No browser, no webview. What the video shows is a real Emacs session: - Drawing with Excalidraw's tools, hand-drawn strokes and fonts included; labels are typed in the minibuffer with a live preview. - Arrows that bind to shapes and follow them when you move things, including elbow arrows routed around obstacles. - Flowcharts from the keyboard: ⌘ ↓ / ⌘ → grow linked nodes. - Excalidraw's style panel as a transient, with a color picker that uses Excalidraw's palette and hotkeys. - The official library collection (libraries.excalidraw.com), browsed, previewed and added from Emacs. Also in there: .excalidraw files that round-trip with excalidraw.com , groups, frames, images, PNG/SVG export with the scene embedded, dark mode, one scene in several windows, and diagrams from text (the .edsl language of excalidraw-dsl). Large scenes stay responsive: only what changed is repainted, and on macOS a CoreAnimation layer shows the pixels. Requirements: Emacs 32 built from master (the first Emacs with the canvas API), plus cairo and pango. Clone it and run make: that builds the module and byte-compiles the Lisp. It's tested on macOS. Linux and Windows builds compile, but I haven't run them yet, so reports and fixes are very welcome. Repo: github.com/yibie/excali-mode

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论