22 - the line container is markdown's, so the seam is the two spelling asks #120

Merged
lilleman merged 3 commits from 22 into main 2026-09-22 21:47:42 +02:00
8 changed files with 20 additions and 13 deletions
+5 -4
View File
@@ -362,10 +362,11 @@ someone spells it or pins it.
stays in one file rather than splitting across the seam. A rule both directions must answer stays in one file rather than splitting across the seam. A rule both directions must answer
alike — whether a list marker interrupts a paragraph — is one function there too, never a copy alike — whether a list marker interrupts a paragraph — is one function there too, never a copy
per direction, however conservative the copy would be. Where the rule is the emitter's own per direction, however conservative the copy would be. Where the rule is the emitter's own
choice, input consults it rather than restating it: the parser asks `commonMarkSpelling` which choice, input consults it rather than restating it, and that is the only import `parse/` takes
form the emitter picks, and `openingLinkTakesDirective` whether the line a paragraph's opening from `emit/`: the parser asks `commonMarkSpelling` which form the emitter picks, and
link starts forces the directive link, so no fixture the emitter writes can be refused, and a `openingLinkTakesDirective` whether the line a paragraph's opening link starts forces the
spelling the emitter refuses gives its own error rather than a second name for it. 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.
- The attribute vocabulary is ADF's: `adf/` walks it and narrows each value to its kind, and a - 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. 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 Reading a spelling back is the format's own: the reader sits beside the spelling it inverts, so
+2 -1
View File
@@ -1,6 +1,7 @@
import type { AdfMark, AdfNode } from '../../adf/document.ts' import type { AdfMark, AdfNode } from '../../adf/document.ts'
import type { InlineNodeModel } from '../../adf/inline-nodes.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 { carriedInline } from '../opaque-carry.ts'
import { claimsLine, holdsNullCharacter, trimTrailingSpace } from '../commonmark/grammar.ts' import { claimsLine, holdsNullCharacter, trimTrailingSpace } from '../commonmark/grammar.ts'
import { commonMarkLink, linkHref, markSpelling, spellMarkAttributes } from '../mark-spellings.ts' import { commonMarkLink, linkHref, markSpelling, spellMarkAttributes } from '../mark-spellings.ts'
+1 -2
View File
@@ -1,3 +1,4 @@
import type { LineContainer } from '../line-container.ts'
import { backslashEscape, escapesLineClaim, inlineHtmlConstruct, opensBracketedAutolink, opensEmailAutolink, type LinePosition } from '../commonmark/grammar.ts' import { backslashEscape, escapesLineClaim, inlineHtmlConstruct, opensBracketedAutolink, opensEmailAutolink, type LinePosition } from '../commonmark/grammar.ts'
import { backtickRun, closingBacktickRun } from '../commonmark/backtick-runs.ts' import { backtickRun, closingBacktickRun } from '../commonmark/backtick-runs.ts'
import { claimsDirectivePrefix } from '../directive-syntax.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 } 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 EmittedDelimiter = { closes: boolean; offset: number; pair: number; width: number }
type EmittedRun = { canClose: boolean; canOpen: boolean; character: string; delimiters: EmittedDelimiter[]; length: number; start: number } type EmittedRun = { canClose: boolean; canOpen: boolean; character: string; delimiters: EmittedDelimiter[]; length: number; start: number }
+1
View File
@@ -0,0 +1 @@
export type LineContainer = 'heading' | 'paragraph' | 'table-cell'
+1 -1
View File
@@ -1,7 +1,7 @@
import type { AdfMark, AdfNode } from '../../adf/document.ts' import type { AdfMark, AdfNode } from '../../adf/document.ts'
import type { DirectiveSpan, NestedSpans } from '../directive-syntax.ts' import type { DirectiveSpan, NestedSpans } from '../directive-syntax.ts'
import type { EmphasisPairing } from '../commonmark/emphasis-matching.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 type { LinkDefinition } from '../commonmark/link-syntax.ts'
import { backslashEscape, decodeTextEscapes, inlineHtmlConstruct, readBracketedAutolink, readEmailAutolink, trimTrailingSpace } from '../commonmark/grammar.ts' import { backslashEscape, decodeTextEscapes, inlineHtmlConstruct, readBracketedAutolink, readEmailAutolink, trimTrailingSpace } from '../commonmark/grammar.ts'
import { backtickRun, closingBacktickRun } from '../commonmark/backtick-runs.ts' import { backtickRun, closingBacktickRun } from '../commonmark/backtick-runs.ts'
+1 -1
View File
@@ -2,7 +2,7 @@ import type { AdfDocument, AdfNode } from '../../adf/document.ts'
import type { Block, DirectiveBlock } from './blocks.ts' import type { Block, DirectiveBlock } from './blocks.ts'
import type { BlockDirectiveNode } from './directive-nodes.ts' import type { BlockDirectiveNode } from './directive-nodes.ts'
import type { ConvertFault } from '../../result.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 type { LinkDefinitions } from './inline-content.ts'
import { carryName, readCarriedBlock } from '../opaque-carry.ts' import { carryName, readCarriedBlock } from '../opaque-carry.ts'
import { commonMarkSpelling, type SpellingMemo } from '../emit/adf-to-markdown.ts' import { commonMarkSpelling, type SpellingMemo } from '../emit/adf-to-markdown.ts'
+8
View File
@@ -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, `blockDirectiveForm`, `blockArgument` and the `spell*Directive*` family keep the word,
naming the spelling rather than the node. 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`
- [ ] **5 — Ship `0.1.0`.** Only the maintainer's own acts are left (§15): make the Gitea repo - [ ] **5 — Ship `0.1.0`.** Only the maintainer's own acts are left (§15): make the Gitea repo
+1 -4
View File
@@ -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 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 measurement repeatable, or state the number the floor may be raised to and why it is not
the measured one. 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`).** - [ ] **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 `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 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] **19 — A home for what both formats read (`0.2.0`).**
- [x] **20 — The give-way channel is unmistakable (`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] **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] **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] **29 — The README reads raw HTML as refused for good (`0.2.0`).**
- [x] **30 — AGENTS.md says each thing once (`0.2.0`).** - [x] **30 — AGENTS.md says each thing once (`0.2.0`).**