From 2f7005590c6d08119fd4ae35a28a1777e4ee84de Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Mon, 21 Sep 2026 22:15:27 +0200 Subject: [PATCH] 22 - the line container is markdown's, so the seam is the two spelling asks --- AGENTS.md | 4 +++- src/markdown/emit/inline-line.ts | 3 ++- src/markdown/emit/line-escaping.ts | 3 +-- src/markdown/line-container.ts | 1 + src/markdown/parse/inline-content.ts | 2 +- src/markdown/parse/markdown-to-adf.ts | 2 +- todo-history.md | 8 ++++++++ todo.md | 5 +---- 8 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 src/markdown/line-container.ts diff --git a/AGENTS.md b/AGENTS.md index f7972af..a73c5ac 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -365,7 +365,9 @@ someone spells it or pins it. choice, input consults it rather than restating it: the parser asks `commonMarkSpelling` which form the emitter picks, and `openingLinkTakesDirective` whether the line a paragraph's opening link starts forces the directive link, so no fixture the emitter writes can be refused, and a - spelling the emitter refuses gives its own error rather than a second name for it. + spelling the emitter refuses gives its own error rather than a second name for it. Those two asks + are the whole of `parse/` → `emit/`, so a grep for `../emit/` under `parse/` reads the seam + entire: what both directions read sits at the format level, a type included. - The attribute vocabulary is ADF's: `adf/` walks it and narrows each value to its kind, and a format spells the narrowed value. A spelling that re-checks the type is the check's second copy. Reading a spelling back is the format's own: the reader sits beside the spelling it inverts, so diff --git a/src/markdown/emit/inline-line.ts b/src/markdown/emit/inline-line.ts index 407cf6c..25d3344 100644 --- a/src/markdown/emit/inline-line.ts +++ b/src/markdown/emit/inline-line.ts @@ -1,6 +1,7 @@ import type { AdfMark, AdfNode } from '../../adf/document.ts' import type { InlineNodeModel } from '../../adf/inline-nodes.ts' -import { assembleInlineLine, isSyntax, type InlineEscaping, type InlineSegment, type LineContainer, type NodeRange } from './line-escaping.ts' +import type { LineContainer } from '../line-container.ts' +import { assembleInlineLine, isSyntax, type InlineEscaping, type InlineSegment, type NodeRange } from './line-escaping.ts' import { carriedInline } from '../opaque-carry.ts' import { claimsLine, holdsNullCharacter, trimTrailingSpace } from '../commonmark/grammar.ts' import { commonMarkLink, linkHref, markSpelling, spellMarkAttributes } from '../mark-spellings.ts' diff --git a/src/markdown/emit/line-escaping.ts b/src/markdown/emit/line-escaping.ts index 379f232..e6bd866 100644 --- a/src/markdown/emit/line-escaping.ts +++ b/src/markdown/emit/line-escaping.ts @@ -1,3 +1,4 @@ +import type { LineContainer } from '../line-container.ts' import { backslashEscape, escapesLineClaim, inlineHtmlConstruct, opensBracketedAutolink, opensEmailAutolink, type LinePosition } from '../commonmark/grammar.ts' import { backtickRun, closingBacktickRun } from '../commonmark/backtick-runs.ts' import { claimsDirectivePrefix } from '../directive-syntax.ts' @@ -21,8 +22,6 @@ export type AssembledLine = { line: string; openingLinkAsDirective?: true; unspe type ScanLine = { position: LinePosition; start: number; text: string } -export type LineContainer = 'heading' | 'paragraph' | 'table-cell' - type EmittedDelimiter = { closes: boolean; offset: number; pair: number; width: number } type EmittedRun = { canClose: boolean; canOpen: boolean; character: string; delimiters: EmittedDelimiter[]; length: number; start: number } diff --git a/src/markdown/line-container.ts b/src/markdown/line-container.ts new file mode 100644 index 0000000..2b9df85 --- /dev/null +++ b/src/markdown/line-container.ts @@ -0,0 +1 @@ +export type LineContainer = 'heading' | 'paragraph' | 'table-cell' diff --git a/src/markdown/parse/inline-content.ts b/src/markdown/parse/inline-content.ts index 38fa719..494ecc3 100644 --- a/src/markdown/parse/inline-content.ts +++ b/src/markdown/parse/inline-content.ts @@ -1,7 +1,7 @@ import type { AdfMark, AdfNode } from '../../adf/document.ts' import type { DirectiveSpan, NestedSpans } from '../directive-syntax.ts' import type { EmphasisPairing } from '../commonmark/emphasis-matching.ts' -import type { LineContainer } from '../emit/line-escaping.ts' +import type { LineContainer } from '../line-container.ts' import type { LinkDefinition } from '../commonmark/link-syntax.ts' import { backslashEscape, decodeTextEscapes, inlineHtmlConstruct, readBracketedAutolink, readEmailAutolink, trimTrailingSpace } from '../commonmark/grammar.ts' import { backtickRun, closingBacktickRun } from '../commonmark/backtick-runs.ts' diff --git a/src/markdown/parse/markdown-to-adf.ts b/src/markdown/parse/markdown-to-adf.ts index 14310cd..021c003 100644 --- a/src/markdown/parse/markdown-to-adf.ts +++ b/src/markdown/parse/markdown-to-adf.ts @@ -2,7 +2,7 @@ import type { AdfDocument, AdfNode } from '../../adf/document.ts' import type { Block, DirectiveBlock } from './blocks.ts' import type { BlockDirectiveNode } from './directive-nodes.ts' import type { ConvertFault } from '../../result.ts' -import type { LineContainer } from '../emit/line-escaping.ts' +import type { LineContainer } from '../line-container.ts' import type { LinkDefinitions } from './inline-content.ts' import { carryName, readCarriedBlock } from '../opaque-carry.ts' import { commonMarkSpelling, type SpellingMemo } from '../emit/adf-to-markdown.ts' diff --git a/todo-history.md b/todo-history.md index 9d0c615..f87d4e7 100644 --- a/todo-history.md +++ b/todo-history.md @@ -1010,6 +1010,14 @@ The done `todo.md` items in full, as they were written. `todo.md` keeps a one-li `blockDirectiveForm`, `blockArgument` and the `spell*Directive*` family keep the word, naming the spelling rather than the node. +- [x] **22 — `LineContainer` sits at the markdown level (`0.2.0`).** Two of the four + `parse/` → `emit/` imports fetch this type from `emit/line-escaping.ts`, camouflaging the two + that are the deliberate spelling consultation. Move it, and name those two in §11 as the whole + of that surface, so a reviewer checks the seam with one grep. + **Done** (2026-09-21): the type is `markdown/line-container.ts`, read by both directions, so + `parse/` imports `emit/` twice — `commonMarkSpelling` and `openingLinkTakesDirective` — and + §11 says those two are the whole of the seam a `../emit/` grep under `parse/` reads. + ## 5 — Ship `0.1.0` - [ ] **5 — Ship `0.1.0`.** Only the maintainer's own acts are left (§15): make the Gitea repo diff --git a/todo.md b/todo.md index e60fea0..0f9ac99 100644 --- a/todo.md +++ b/todo.md @@ -56,10 +56,6 @@ chunk clearing a §11 seam. upward, so the first raise to the measured figure reddens a run that changed nothing. Make the measurement repeatable, or state the number the floor may be raised to and why it is not the measured one. -- [ ] **22 — `LineContainer` sits at the markdown level (`0.2.0`).** Two of the four - `parse/` → `emit/` imports fetch this type from `emit/line-escaping.ts`, camouflaging the two - that are the deliberate spelling consultation. Move it, and name those two in §11 as the whole - of that surface, so a reviewer checks the seam with one grep. - [ ] **32 — The mark depth `adf/` counts is stated in ADF's terms (`0.2.0`).** `document.ts`'s `markAttributeNesting` is `largestNesting - 3`, and both the comment above it and AGENTS.md §8 give the reason as markdown's: the block directive spells the whole mark set @@ -292,6 +288,7 @@ chunk clearing a §11 seam. - [x] **19 — A home for what both formats read (`0.2.0`).** - [x] **20 — The give-way channel is unmistakable (`0.2.0`).** - [x] **21 — The ADF tables carry ADF's nouns (`0.2.0`).** +- [x] **22 — `LineContainer` sits at the markdown level (`0.2.0`).** - [x] **28 — `emitLine`'s retry loop cannot spin (`0.2.0`).** - [x] **29 — The README reads raw HTML as refused for good (`0.2.0`).** - [x] **30 — AGENTS.md says each thing once (`0.2.0`).**