Skip to content

Commit 4c71dbc

Browse files
committed
more notes for claude
1 parent 3b49c7e commit 4c71dbc

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

crates/quarto-markdown-pandoc/CLAUDE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The error message infrastructure is based on Clinton Jeffery's TOPLAS 2003 paper
3030

3131
LR parser generators are powerful and well-understood, but the parsers they generate are not suited to provide good error messages. Many compilers incur extensive modifications to the source grammar to produce useful syntax error messages. Interpreting the parse state (and input token) at the time of error is a nonintrusive alternative that does not entangle the error recovery mechanism in error message production. Unfortunately, every change to the grammar may significantly alter the mapping from parse states to diagnostic messages, creating a maintenance problem. Merr is a tool that allows a compiler writer to associate diagnostic messages with syntax errors by example, avoiding the need to add error productions to the grammar or interpret integer parse states. From a specification of errors and messages, Merr runs the compiler on each example error to obtain the relevant parse state and input token, and generates a yyerror() function that maps parse states and input tokens to diagnostic messages. Merr enables useful syntax error messages in LR-based compilers in a manner that is robust in the presence of grammar changes.
3232

33-
We're not using "merr" here; we are implementing the same technique.
33+
We're not using "merr" here; we are merely implementing the same technique.
3434

3535
## Creating error examples
3636

@@ -65,3 +65,4 @@ The `quarto-markdown-pandoc` binary accepts the following options:
6565
- When I say "@doit", I mean "create a plan, and work on it item by item."
6666
- When you're done editing a Rust file, run `cargo fmt` on it.
6767
- If I ask you to write notes to yourself, do it in markdown and write the output in the `docs/for-claude` directory.
68+
- If you need more information on the syntax differences, you are allowed to read the [syntax notes](../../docs/syntax-notes.md) file.

docs/syntax-notes.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ we desugar them to Pandoc spans in a Rust filter.
2121
### Footnotes
2222

2323
We parse footnotes differently from Pandoc.
24-
We use NoteReference (Inline) and NoteDefinition (block) nodes.
24+
We use NoteReference (Inline), NoteDefinitionPara (single paragraph), and NoteDefinitionBlock (multiple paragraph) nodes.
2525
These are desugared into spans and divs in a Rust filter.
2626

2727
### Editor markup
@@ -216,14 +216,26 @@ Consider `^[footnote-or-span]{.class}^`. `^[` denotes both the start of a footno
216216
Quarto-markdown's parser prefers the footnote interpretation. In case an immediately nested span is needed, use a space between `^` and `[`.
217217
Superscript nodes with leading spaces are disallowed in Pandoc, but Quarto-markdown will trim spaces.
218218

219-
## QMD _REMOVALS_
219+
## Differences from Pandoc
220220

221-
- Simplified link syntax. the only link syntax supported are _inline links_: `[text](destination title)`
221+
### Single link syntax
222222

223-
- no wikilink support
223+
Links always need to be defined fully. `[LaTeX Output]` doesn't work; `[LaTeX Output](#latex-output)` does.
224224

225-
- no shortcut reference link support, we use that syntax for spans instead
225+
We have no support for wikilink syntax.
226+
227+
We have no shortcut reference link support: that syntax is used for spans.
228+
229+
Similarly, the only image syntax supported is the one corresponding to inline links: `![text](image-name title)`
230+
231+
### Quoting differences
232+
233+
`''` and `""` are parsed as empty `Quoted` objects by `quarto-markdown`.
234+
235+
### No naked HTML support
236+
237+
In Pandoc, you can intersperse HTML and Markdown, and Pandoc will (attempt to) parse the HTML into
238+
its AST format. This is brittle and inefficient because it relies heavily on backtracking through
239+
parser combinators. In `quarto-markdown`, use the raw block and inline syntax directly.
226240

227-
- Similarly, the only image syntax supported is the one corresponding to inline links: `![text](image-name title)`
228241

229-
- no HTML support: QMD is meant to translate into more than one syntax. We use rawblock instead.

0 commit comments

Comments
 (0)