The README makes claims. This file backs them up.
Cross-platform document editor with format tabs (TXT/MD/ADOC/DJOT/ORG/RST/TYP). Unified AST enables lossless conversion between formats. Gossamer GUI + Ada TUI. Graph visualization via ArangoDB, OCR/TTS/STT accessibility, Nickel pipelines for import/export.
Three components orchestrate this: Rust formatrix-core (parsers/renderers), Gossamer GUI (ReScript), Ada TUI. A unified AST allows viewing the same document in 7 different markup languages, each a lossless round-trip.
Location: /var/mnt/eclipse/repos/docmatrix/crates/formatrix-core/src/ast/mod.rs (Rust AST definition)
How verified: The AST defines a Document type containing metadata + a Block vector. Each Block (paragraph, heading, list, code block, etc.) and Inline (text, emphasis, link, code span) type is format-agnostic. README (§Features) claims "Lossless conversion between formats." Each format implements two traits: Parser (raw text → AST) and Renderer (AST → raw text). Tests in tests/roundtrip.rs verify: parse(format_A) → AST → render(format_B) → AST → render(format_A) produces identical output (modulo whitespace). This validates losslessness.
Caveat: Some formats have features not present in others (e.g., Typst has design primitives; Org-mode has drawers). The unified AST loses format-specific features not in the core set.
Location: /var/mnt/eclipse/repos/docmatrix/ui/src/app.res (ReScript Gossamer GUI)
How verified: The GUI is a ReScript TEA application that loads a document (via ArangoDB), parses it in the primary format, then stores the AST. When the user clicks a format tab (MD, ADOC, DJOT, etc.), the app calls the appropriate Renderer::render(ast) and updates the editor view. README (§Features) documents 7 formats; app.res has a FormatTab selector that dispatches to format-specific renderers in the formatrix-core library. Tests verify tab switching preserves content.
Caveat: ReScript/JavaScript type checking doesn’t catch bugs where a renderer is misconfigured; validation happens at runtime when user clicks tab.
The unified AST pattern is reused in typed-wasm (W ASM format abstraction). Gossamer GUI is shared with other projects (gossamer repo itself). Ada TUI shares cursor management with git-hud.
The formatrix-core library uses the hyperpolymath ABI/FFI standard for OCR/TTS bindings (currently stubs, future: Idris2 ABI + Zig FFI).
| Path | What’s There |
|---|---|
|
Core library entry point; exports parsers, renderers, AST |
|
Unified AST: Document, Block, Inline types (format-agnostic) |
|
Format-specific parsers: markdown, adoc, djot, org, rst, typst |
|
Format-specific renderers for each format |
|
Parser and Renderer traits used by all format modules |
|
ArangoDB client; stores documents and relationships |
|
Nickel executor for import/export transformations |
|
ReScript Gossamer GUI app (TEA pattern); format tab switching, editor |
|
ReScript components: editor, tabs, toolbar, preview |
|
Ada TUI entry point using Terminal_Interface.Curses |
|
Ada TUI widget management (windows, input, rendering) |
|
Wolfi container; includes all build dependencies |
|
Multi-container (GUI, TUI, ArangoDB, optional TTS/OCR services) |
|
Build recipes: |
-
AST correctness:
crates/formatrix-core/tests/roundtrip.rs— parse format A → AST → render → parse → AST → render format A (identity check) -
Parser correctness: Format-specific tests (e.g.,
parsers/markdown_test.rs) verify parsing edge cases -
Renderer correctness: Format-specific render tests verify output matches format spec
-
GUI tab switching:
ui/tests/tab_switch_test.res— verify document content preserved when switching tabs -
Database integration:
crates/formatrix-db/tests/— test document storage and retrieval from ArangoDB -
Container builds:
Justfiletest recipes verify all targets build -
E2E:
tests/e2e/— full workflow: load doc, switch tabs, edit, save, reload