Skip to content

xiaodou997/marklight

Repository files navigation

MarkLight Logo

MarkLight

A local-first Markdown editor built with Tauri 2, a Rust domain core, and TipTap.

English · 简体中文 · 日本語 · 한국어

Version Gitee Apache-2.0

Highlights

  • WYSIWYG editing: powered by TipTap / ProseMirror, with editable rendered blocks for code, tables, math, Mermaid diagrams, callouts, and more.
  • Local-first workflow: documents, images, and workspaces stay on your machine. Dropped images are saved into an assets/ folder next to the current document.
  • Desktop-native experience: multi-window editing, persisted window state, native menus, and system printing.
  • Structured workspaces: Rust handles directory filtering, watcher aggregation, external change events, and save-conflict detection.
  • WeChat and HTML export: the frontend renders export-ready content while the native layer handles printing and file writes.

Architecture

MarkLight uses three clear layers:

  • Vue 3 + Pinia + TipTap: UI, editor interactions, and command dispatch.
  • Tauri 2: plugins, permission boundaries, and the command/event bridge.
  • Rust domain core: document, workspace, window runtime, and watcher consistency.

Project constraints:

  • Frontend business logic does not call invoke, listen, or emit directly.
  • Public Rust commands return structured DTOs and AppError.
  • Common desktop capabilities should use official Tauri plugins first.

More documentation:

Tech Stack

  • Desktop framework: Tauri 2
  • Native core: Rust
  • Frontend: Vue 3 + TypeScript + Pinia + Vite
  • Editor: TipTap / ProseMirror
  • Markdown: markdown-it + custom parser / serializer
  • Styling: Tailwind CSS
  • Native plugins: store / window-state / dialog / opener / cli

Development

bun install
bun run dev
bun run dev:tauri
bun run build
bun run build:tauri
bun run lint
bun run format
bunx vue-tsc --noEmit
bun run test
cargo check --manifest-path src-tauri/Cargo.toml

Current Architecture Notes

  • Save-conflict detection is centralized in Rust save_document.
  • Workspace watcher events are normalized as workspace-changed.
  • Startup open, system open, and multi-window pending open requests share the app-open-paths payload model.
  • App.vue is now a composition surface. Document, workspace, and window lifecycles live in dedicated session composables.

Contributing

  • Issues and pull requests are welcome on GitHub.
  • Before changing architecture or ownership boundaries, read docs/ARCHITECTURE.md and docs/ENGINEERING_STANDARDS.md.
  • When adding a capability, first justify why it cannot be handled by existing plugins or domain modules.

License

MarkLight is open source under the Apache License 2.0.

About

🚀 基于 Tauri 2.0 + ProseMirror 的高性能 Markdown 编辑器 | 所见即所得 | 微信排版 | 数学公式 | 焦点写作

Topics

Resources

License

Stars

16 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors