The Quarto Rust monorepo (q2) is a next-generation implementation of Quarto that combines high-performance document processing with real-time collaborative editing. This repository aims to replace parts of the TypeScript/Deno runtime with a unified Rust implementation to enable shared validation logic, improved performance for Language Server Protocol (LSP) operations, and single-binary distribution README.md1-12
The project encompasses:
pampa crate) that parses Quarto Markdown (QMD) using Tree-sitter and produces Pandoc AST with full source location tracking README.md29-34hub-client) with CRDT-based synchronization using Automerge, enabling real-time collaboration Cargo.toml147-148SourceInfo through all transformations for accurate error reporting README.md62-69ReplayDrawer) that allows users to navigate and restore previous versions of collaborative documents hub-client/src/components/ReplayDrawer.tsx42-148For detailed information about specific subsystems, see:
Sources: README.md1-69 Cargo.toml1-152 hub-client/src/components/ReplayDrawer.tsx42-148
The repository is organized as a Cargo workspace for Rust crates and utilizes npm for TypeScript packages. WASM crates are excluded from the default workspace to avoid native dependency conflicts and specialized build requirements Cargo.toml8-12
Title: q2 Workspace Organization
Workspace Categories
| Category | Major Crates | Role |
|---|---|---|
| Binaries | pampa, quarto-hub | CLI tools and the collaboration server Cargo.toml147-148 |
| Core | quarto-core, quarto-source-map | Rendering orchestration and unified location tracking README.md53-55 |
| Document | quarto-pandoc-types | Pandoc AST type definitions and serialization README.md59-61 |
| Parsing | tree-sitter-qmd, quarto-yaml | Incremental Markdown and YAML parsing README.md56-57 |
| WASM | wasm-qmd-parser | Browser-side parsing and rendering bindings Cargo.toml86-87 |
For a full list of crates and directory roles, see Repository Structure.
Sources: Cargo.toml1-152 README.md49-61
The system architecture bridges the gap between traditional static site generation and dynamic collaborative editing.
Title: QMD Processing and Collaboration Flow
Key Architectural Layers
quarto-ast-reconcile crate allows for reconciliation to align original and modified ASTs Cargo.toml126-127quarto-core that handles template injection and SASS compilation Cargo.toml93-94 Cargo.toml114-115quarto-sync-client manages DocHandle instances and WebSocket communication ts-packages/quarto-sync-client/src/client.ts9-38For detailed diagrams of these interactions, see Architecture Diagrams.
Sources: README.md27-48 ts-packages/quarto-sync-client/src/client.ts9-38 Cargo.toml126-148
wasm32-unknown-unknown for browser-based tools README.md13-26tree-sitter-qmd grammar, enabling fast, incremental parsing Cargo.toml77-81hub-client to provide a VS Code-like editing experience with real-time presence indicators hub-client/src/components/Editor.tsx164-171Sources: README.md13-95 Cargo.toml77-81 Cargo.lock179-182 hub-client/src/components/Editor.tsx164-171
The repository includes an xtask system for project-specific automation and a plan-driven development workflow managed via beads CLAUDE.md23-57
| Tool / Command | Function |
|---|---|
cargo xtask verify | Full CI-mirror: lints, builds, and tests the entire workspace including WASM and TS README.md103-104 |
br (Beads) | Issue tracking and task management integrated with the codebase CLAUDE.md52-57 |
cargo nextest | Recommended test runner for the workspace CLAUDE.md32 |
insta | Snapshot testing framework used extensively for AST and rendering verification Cargo.toml29 |
For more on the build system and TDD workflow, see Repository Structure.
Sources: README.md103-108 CLAUDE.md23-57 Cargo.toml29
Refresh this wiki
This wiki was recently refreshed. Please wait 5 days to refresh again.