Skip to content

The site's reference tables are checked against the code, and the claims it makes are tested - #14

Closed
fabeat wants to merge 21 commits into
mainfrom
feature/phase5-reference
Closed

fabeat wants to merge 21 commits into
mainfrom
feature/phase5-reference

Conversation

@fabeat

@fabeat fabeat commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

The site's tables of names are written by hand, and they had already drifted. This makes them generated from the code and adds a test suite for the prose.

What drifted, and is now checked

The site said The code has
"Four themes ship" five — pitch was missing
"Every exception Markdown Presentation throws, in one place" five were missing
"Four read-friendly aliases" six are accepted
"the thirteen style keys" twelve
a Word style-slots table of 7 19
the free shapes not documented at all — twelve names
the Word options table on two pages, and the copies already differed

tools/check-reference.php now reads 17 vocabularies and 181 names out of the class that owns each one, and compares the page that carries it — in both directions. A documented name the code does not have, and an existing name the document does not list, are both failures.

And the rule extends past the site: a vocabulary may be read out of both halves and compared with each other, so a half that grew a ninth attribute is caught in the deck and in the document.

The claims, which a table cannot carry

tests/Claims/ holds the prose claims as tests — the counts, the completeness, the rules. Every one fails against main, because main predates the features they are about.

Three were already waiting on this work and are now real tests rather than pending ones: "refuses a note that is closed but is not last, and says why", "says how the attributes of a shape are separated", and "finds a theme that sits beside the deck" — the last of which is REVIEW.md §8, from before this work began.

What this pull request adds to the site

The slide templates and ::slide-number in the slides half, and the seven object directives in the Word half, with a loss matrix saying what ODT and RTF cannot carry. The three new exceptions listed. The frontmatter key set now nine, the free shapes thirteen, the Word directives ten.

The order of the merges

This pull request must be merged last. The site's continuous integration checks the libraries out from main, so the reference checks compare the pages against libraries that do not have the templates, the object directives or the text styles until those pull requests are merged. Merge the two libraries first.

Three things the writing turned up

The site was wrong about :::toc, and so was a snippet. It said the body of a container is "silently dropped" — nothing is claimed, and DocumentRenderer draws the body as ordinary Markdown with the fence gone. And content/general/errors.md showed a Loss by two methods it does not have: MarkdownWord\Loss has public properties, so the snippet was a fatal error. It was wrong on main too, before this work. Both are corrected, and the old phrasings are in the FORBIDDEN map so they cannot come back.

The deck's own frontmatter is the first slide's — so a deck that opens with a --- block and then another --- gets an empty first slide, and chrome: has to be on the slide that opens the deck. The site now says so.

And a bug in the Word half, not in the documentation: the Word README's format table says a table's column alignment is "carried | dropped | carried", and the ODT really does drop it — but Format::Odt::drops() does not list it, so pendingLosses() says nothing. A reader who aligns a column and converts to ODT loses it in silence. That is a library fix and it is not in this pull request; it is reported there.

fabeat added 21 commits October 27, 2026 16:23
The tables that list a vocabulary are written by hand, and they had drifted: the
site said four themes shipped when five did, its error page said it listed every
exception the package throws and left five of them out, and the Word options
table was on two pages and the two copies already differed.

Every vocabulary is now read out of the library that owns it and compared with
the page that carries it, in both directions. A page says which of its blocks is
the list of what by marking it, and a second copy of a list is a failure as well:
two copies drift apart and the one nobody reads is the one that is wrong.

The drifted claims are corrected, and the tables that were in two places are in
one now.
A table can be checked against the code and a sentence cannot: the counts, the
claims of completeness and the rules a page states are prose, and a prose claim
is correct only until the code moves.

The suite in tests/ asks the code how many there are and the page how many it
says, checks a page that claims to list every exception against the classes the
package throws, and checks the rules against the library that has to behave that
way. The phrases that were wrong and have been corrected go into the FORBIDDEN
map, which now covers the whole site and not only the command-line pages: a
sentence that was wrong is wrong wherever it is written, and the pages that
drifted most were the ones nothing was checking.
The workflow built the site with npm run build, which renders "This example did
not build" into the page and succeeds anyway: a broken example was a green
build. The strict build is the one that is asked for now, and the two checks
that keep the pages true of the code run beside it.
The index of the site is a template, and a template carries a page's summary in
the page it builds from — so a phrase that was wrong is looked for in the
Markdown and in the templates that render it.
The frontmatter keys of the Word half are open-ended — the library validates
two of them and reads the rest — so there is no list of them to check a page
against. The options, the style slots and the themes are.
Both halves can write a word in a style of its own, and the syntax and the
attributes are the same in the two. The page that explains how a directive
works is where the shared vocabulary belongs, and the eight attributes are a
vocabulary the reference check reads out of both halves and holds to one list —
so a half that grew a ninth attribute is caught rather than documented.
An inline directive in a deck is a text style, so every one of them is either
a name the theme has or a build that stops with the styles it has named. The
page says so, and the claims check it: the refusal, the message, the theme's
file, and the three forms the raw one takes.

The example is the raw form, because no theme that ships carries named styles
yet — the named one is proved by a theme of the test's own.
A name the theme does not have, a label that holds Markdown, an attribute
nobody reads — each of them reaches the document as the characters the author
typed, because a sentence and a parser nobody asked to change should not change
the syntax of every document converted after it.

The round trip keeps the word and loses the style, and the page says so: a
style is written as direct formatting, and the reader reads bold, italic and
strike and no colour.
Three directives and not two, three methods on the renderer and not two, and
the exception a theme naming a face there is no table for — each of them a
count the code is asked about, and each of them now checked.

The index pages carry the inline directive as well, because a deck's dialect
now has one and the index is where the dialect is listed.
Three sentences were wrong and have been corrected: the round-trip page's
count of what does not survive, the Word index's count of the directives, and
the presentation index's count of the renderer's methods. A count that was
wrong once tends to come back, because the code moved on and the sentence did
not — so the phrases are here, and a page that says one again is a failure.
The reference tables are read out of the libraries and compared with the pages
that carry them, and a vocabulary the two halves share is read out of both of
them and held to one list — so the attributes an inline style takes are the
same eight in the deck and in the document.
A word in a named style comes back as the word, without the style and without
the colour it was drawn in, and the package's own list of what does not travel
now says so. The index summarised that list, and the summary was one item
short.
A template is the furniture of a deck — the wordmark, the rule, the page
number — written once and drawn on every slide that names it. It is a slide
of the deck's own Markdown whose frontmatter names a template and nothing
else, and it is not a slide of the deck: it is not drawn, it has no number,
and it does not count towards the number of slides.

Four things decide what one is, and the pages now say them: the body holds
chrome and nothing else, a slide may name several templates, `layout:` and
`template:` are independent, and the deck's own templates override the
imported ones of the same name. A template may also live in a file beside
the deck, named with `chrome:` in the deck's own frontmatter. `::slide-number`
is a shape like any other, and `of=true` writes the number of the deck after
the number of the slide.

A rule is a sentence rather than a name, so each is checked against the
library that has to behave that way: a definition that is drawn, a template
that holds a heading, a chrome file that is not there, an imported template
the deck overrides, and a page number that is the number of the deck.
Seven directives place objects in a document: a picture, a caption, a page
break, a section, a floating box, a shape and a form field. The Word half
never refuses — a directive a writer cannot express is given the author's own
characters back and the loss is reported — so the pages say which format
carries what, and the round trip says what comes back of each.

The reference table carries the ten names the library draws, and a new
vocabulary carries the four features a format cannot hold for them, read out
of the class that names them. A caller that builds its own registry draws
fewer than ten, and the page says so: the handlers that are not given are not
drawn, and a conversion through `MarkdownToWord` hands over all of them.
Ten sentences were wrong and have been corrected: the counts of the
frontmatter keys, the free shapes and the Word directives, the two examples
that claimed to use every frontmatter key, the claim that the container form
of a drawn name is claimed rather than drawn, and the snippet that read a
loss by two methods it does not have. A count that was wrong once tends to
come back, because the code moved on and the sentence did not — so the
phrases are here, and a page that says one again is a failure.
The reference tables are read out of the libraries and compared with the
pages that carry them. A vocabulary joins them: the features a Word format
cannot carry, which the pages list beside the directives they belong to.
@fabeat

fabeat commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Consolidated into #15, on the branch feature/integrated that the rest of the suite uses, and with the two new commands the command line gained documented as well. This pull request's work is in that branch, with its commits still separate and named for what they do.

@fabeat fabeat closed this Oct 27, 2026
@fabeat
fabeat deleted the feature/phase5-reference branch October 27, 2026 22:39
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant