Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# Quarto Markdown

The main documentation for this repository is located at:
[crates/quarto-markdown-pandoc/CLAUDE.md](crates/quarto-markdown-pandoc/CLAUDE.md)
# Quarto Rust monorepo

## **WORK TRACKING**

We use bd (beads) for issue tracking instead of Markdown TODOs or external tools.
We use plans for additional context and bookkeeping. Write plans to `claude-notes/plans/YYYY-MM-DD-<description>.md`, and reference the plan file in the issues.

### Quick Reference

Expand Down Expand Up @@ -101,7 +99,19 @@ When fixing ANY bug:
3. **THIRD**: Implement the fix
4. **FOURTH**: Run the test and verify it passes

**This is non-negotiable. Never implement a fix before verifying the test fails. Stop and ask the user if you cannot think of a way to mechanically test the bad behavior.**
**This is non-negotiable. Never implement a fix before verifying the test fails. Stop and ask the user if you cannot think of a way to mechanically test the bad behavior. Only deviate if writing new features.**

## Workspace structure

### `crates` - corresponds to the crates in the public quarto-markdown repo

- `crates/qmd-syntax-helper`: a binary to help users convert qmd files to the new syntax
- `crates/quarto-error-reporting`: a library to help create uniform, helpful, beautiful error messages
- `crates/quarto-markdown-pandoc`: a binary to parse qmd text and produce Pandoc AST and other formats
- `crates/quarto-source-map`: a library to help maintain information about the source location of data structures in text files
- `crates/quarto-yaml`: a YAML parser that produces YAML objects and accurate fine-grained source location of elements
- `crates/tree-sitter-qmd`: tree-sitter grammars for block and inline parsers
- `crates/wasm-qmd-parser`: A WASM module with some entry points from `crates/quarto-markdown-pandoc`

## General Instructions

Expand All @@ -118,6 +128,6 @@ When fixing ANY bug:
- Always create a plan. Always work on the plan one item at a time.
- In the tree-sitter-markdown and tree-sitter-markdown-inline directories, you rebuild the parsers using "tree-sitter generate; tree-sitter build". Make sure the shell is in the correct directory before running those. Every time you change the tree-sitter parsers, rebuild them and run "tree-sitter test". If the tests fail, fix the code. Only change tree-sitter tests you've just added; do not touch any other tests. If you end up getting stuck there, stop and ask for my help.
- When attempting to find binary differences between files, always use `xxd` instead of other tools.
- .c only works in JSON formats. Inside Lua filters, you need to use Pandoc's Lua API. Study https://raw.githubusercontent.com/jgm/pandoc/refs/heads/main/doc/lua-filters.md and make notes to yourself as necessary (use docs/for-claude in this directory)
- .c only works in JSON formats. Inside Lua filters, you need to use Pandoc's Lua API. Study https://raw.githubusercontent.com/jgm/pandoc/refs/heads/main/doc/lua-filters.md and make notes to yourself as necessary (use claude-notes in this directory)
- Sometimes you get confused by macOS's weird renaming of /tmp. Prefer to use temporary directories local to the project you're working on (which you can later clean)
- The documentation in docs/ is a user-facing Quarto website. There, you should document usage and not technical details.
56 changes: 56 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 18 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ members = [
resolver = "2"

[workspace.package]
version = "0.1.0"
authors = ["Posit Software, PBC"]
homepage = "https://github.com/posit-dev/quarto-markdown-syntax"
keywords = ["parser"]
Expand All @@ -16,21 +17,25 @@ edition = "2024"

[workspace.dependencies]
anyhow = "1.0.89"
ariadne = "0.4"
clap = { version = "4.5", features = ["derive", "cargo"] }
insta = "1.40.0"
memchr = "2.7.4"
once_cell = "1.19"
proc-macro2 = "1.0.94"
schemars = "0.8.21"
serde = "1.0.215"
serde = { version = "1.0.215", features = ["derive"] }
serde_json = "1.0.132"
serde_yaml = "0.9"
thiserror = "1.0"
toml = "0.8.19"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
yaml-rust2 = "0.10"

[workspace.dependencies.proc-macro-error2]
version = "2.0.1"
default-features = false

[workspace.dependencies.tests_macros]
path = "./crates/tests_macros"

[workspace.dependencies.tracing]
version = "0.1.40"
features = ["std"]
Expand All @@ -42,15 +47,21 @@ version = "0.25.8"
[workspace.dependencies.tree-sitter-qmd]
path = "./crates/tree-sitter-qmd"

[workspace.dependencies.tree-sitter-sexpr]
path = "./crates/tree-sitter-sexpr"

[workspace.dependencies.wasm-qmd-parser]
path = "./crates/wasm-qmd-parser"

[workspace.dependencies.quarto-markdown-pandoc]
path = "./crates/quarto-markdown-pandoc"

[workspace.dependencies.quarto-yaml]
path = "./crates/quarto-yaml"

[workspace.dependencies.quarto-error-reporting]
path = "./crates/quarto-error-reporting"

[workspace.dependencies.quarto-source-map]
path = "./crates/quarto-source-map"


[workspace.lints.clippy]
assigning_clones = "warn"
Expand Down
24 changes: 24 additions & 0 deletions crates/quarto-error-reporting/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "quarto-error-reporting"
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
description = "Error reporting and diagnostic messages for Quarto"

[dependencies]
# Source location tracking
quarto-source-map = { path = "../quarto-source-map" }

# Error reporting
ariadne = { workspace = true }
thiserror = { workspace = true }
once_cell = { workspace = true }

# Serialization
serde = { workspace = true }
serde_json = { workspace = true }

[dev-dependencies]
# No dev dependencies yet
Loading