feat: normalize all changed reference docs after generation - #732
feat: normalize all changed reference docs after generation#732Iheanacho-ai wants to merge 1 commit into
Conversation
72bfdf0 to
01bfdad
Compare
|
Review pass, tooling findings. One blocking item, the rest are latent cases that aren't in the corpus today. 1. Blocking: the container path passes a flag the published image doesn't have. This is worse than a merge-window race. 2. Nothing in CI runs the tests. 3. An unpaired backtick silently disables escaping for the rest of the line. No such line in the corpus today, but this is upstream CLI help text we don't control. Consider only honoring the toggle when the line has an even backtick count. 4. The one true non-idempotency I could find. 5. CRLF defeats the whole pass. 6. Output isn't regenerated in this PR. The next Two nits. Verified, and this held up well. I built the tool and ran it twice over all 288 reference |
70794fd to
6624822
Compare
6624822 to
89823d6
Compare
What
Make
mdx-normalizesafe to run across the whole reference tree, and wire itinto every reference generator so generated docs are normalized automatically.
Why
mdx-normalizewas hardcoded to two Omni files with always-on inline escaping, which corrupted real HTML (<table>→\<table>), re-escaped safe{"<"}/{/* */}, and fenced nested lists. So it couldn't run on the Talos reference or twice, and only omni-cli/image-factory generators normalized at all.Change
</{escaping is now opt-in (--escape-inline); existing MDX expressions/comments are preserved; nested lists are re-indented, not fenced; accepts multiple file paths; every transformation is idempotent. Tests added for tables, expressions/comments, nested lists, and normalize-twice == normalize-once.normalize-doc/normalize-doc-localnormalize the changed reference files (.mdxunder any/reference/path), no arguments needed, with flags chosen by path. Added the normalize step to the four generators that lacked it, so all eight now normalize their output.Note: the container target runs the published
mdx-normalize:latestimage — CI must republish it for the container path; until then use-local.Testing
go test ./...andgo vet ./...pass.make generate-talos-reference(v1.13): completion blocks fenced, all tables intact, no\</\{anywhere.--escape-inlinerouting: bare<machine-id>escaped in omnicli.mdx; the 46-tableomni-configuration.mdxnormalizes to a no-op.