Coflat is a semantic document editor for mathematical writing. It targets papers, notes, books, and lecture-style documents that need equations, theorem-like blocks, citations, cross-references, figures, tables, and Pandoc export.
The app has one shared markdown boundary format and two editor surfaces: CM6 rich mode and CM6 source mode.
pnpm install
pnpm dev # browser app at localhost:5173
pnpm tauri:dev # desktop appUseful verification commands:
pnpm typecheck
pnpm test
pnpm test:browser
pnpm buildStart here:
- docs/authoring.md - user guide for writing math, theorem blocks, references, citations, media, tables, and exporting.
- FORMAT.md - canonical Pandoc-flavored markdown format.
- docs/editor-surfaces.md - CM6 rich and source-mode behavior over that format.
- DESIGN.md - product philosophy and high-level architecture.
- docs/getting-started.md - development workflow and reading order.
- docs/feature-inventory.md - product surface checklist for compatibility and rebuild work.
- AGENTS.md - repository commands, conventions, debug helpers, and local automation guidance.
Implementation details live under docs/architecture.
Coflat documents are Pandoc-flavored markdown. The format uses Pandoc-native constructs wherever possible:
- YAML frontmatter for document metadata and editor/export settings.
- Fenced divs for theorem-like blocks, proofs, figures, tables, and custom semantic blocks.
$...$,$$...$$,\(...\), and\[...\]for math.- pandoc-crossref-style labels such as
{#eq:einstein}. [@id]syntax for citations and cross-references.
Pandoc owns export. The editor does not run Pandoc in the live editing loop.
- CM6 rich mode keeps markdown as the live source of truth and renders rich widgets over it.
- CM6 source mode edits the raw markdown.
The app shell, file IO, semantic services, document format, and Tauri backend are shared across surfaces.
- TypeScript, React, Vite
- CodeMirror 6
- Lezer markdown parsing with Coflat extensions
- KaTeX
- Tauri v2 desktop shell
- Rust backend for filesystem/native commands
The common local loop is:
pnpm dev
pnpm test:focused -- <test-file>
pnpm check:pre-pushFor browser-driven checks:
pnpm dev
pnpm test:browserFor a stable manual review server:
pnpm dev:showSee docs/verification-workflows.md for the full verification map.