Skip to content

fix(docs): serve agents real pipe tables and unbroken code blocks - #534

Merged
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-12722057
Sep 4, 2026
Merged

fix(docs): serve agents real pipe tables and unbroken code blocks#534
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-12722057

Conversation

@IgorShevchik

Copy link
Copy Markdown
Collaborator

Ports 12722057, partially. Cursor moves to it, which is nuxt/ui v4 HEAD.

Why a commit on skipped infrastructure was not a skip

The subject is upstream's agent-discovery surface, which this fork deliberately does not have: 9ef3ee39 built it, ae243116 refactored it into nuxt-agent-discovery, and both are recorded as skips. The reflex answer here was a third skip, and it would have been wrong.

Reading the diff rather than the subject splits it in two. Half is the module — the ^0.1.1 → ^0.4.0 bump, the prerenderRoutes() deletions that depend on it serving those routes instead — and none of that exists here. The other half fixes two defects in minimark/stringify, which this fork uses through the same call in docs/server/routes/raw/[...slug].md.get.ts.

The defects, measured on our own dependency

node what comes out
table a literal <table> block — the format has no pipe-table handler
pre whose code holds a fence the handler always opens three backticks, so the inner pair closes it early: the rest becomes prose plus a second block

Not hypothetical here. docs/content/ carries markdown tables in 28 files and four-backtick fences in 7 (the typography pages documenting code blocks), and all of it reaches /raw/**.md — which is what skills/b24-ui-nuxt/references/components.md points agents at.

The port

docs/server/utils/markdown.ts is taken as upstream wrote it. The two passes are written against our transformMDC.ts rather than applied as a patch — ours is 1202 lines and diverges in its core (castMap rather than CAST_TEMPLATES, our own generateComponentCode, generateThemeConfig, convertIcon, processLinks). Upstream's other additions in the same commit belong to its own MDC vocabulary and were left alone.

The ordering is load-bearing here and is not upstream

Upstream absolutises links after stringifying, inside the module, so its table pass can sit anywhere. Ours does it on the tree — processLinks rewrites a.href in place — and pipeTable flattens an a node into [text](href) text. Render the tables first and those hrefs are strings before anything rewrites them: relative, and pointing nowhere from a raw file served to an agent.

Confirmed in built output rather than argued — a generated cell reads [TanStack Virtual](https://tanstack.com/virtual/latest/docs/api/virtualizer), rendered and absolute.

The llms.txt half turned up a gap of our own

Widening the filters is not the cosmetic tidy-up it looks like. LIKE '/docs/components/%' matches everything under the section but not the section's own page, and ours exists — docs/content/docs/2.components/0.index.md. The listing carried all 120 component pages and not the page introducing them.

section before after
Components 120 121
Typography absent entirely 20

The Typography gap is ours independently of upstream: 20 pages under docs/content/docs/4.typography/ matched none of our four sections, so the prose components were missing from llms.txt — the only occurrence of the word in the whole file was inside another page's description.

Not taken: the nuxt-agent-discovery bump, the prerenderRoutes() deletions, and a minimumReleaseAgeExclude entry for nuxt-agent-discovery@0.4.0 — a supply-chain exception for a package this fork does not install.

Tests

test/utils/raw-markdown.spec.ts, twelve cases, running against the real stringify rather than a description of it. Two assert the premise — that minimark writes a table as HTML and breaks out of a self-fencing block — so if the dependency grows a table handler the workaround is reported as dead weight instead of quietly staying wrong.

Five mutations verified, each failing its own assertion: fence fixed at three backticks (3 red), pipe escape dropped in a code span, link collapsed to its text, short row not padded, header separator dropped.

A dependency this repository had not declared

Importing the real stringify needed minimark at the rootdocs/package.json declares it, the root did not, and the root is what typechecks test/. The gate caught it from two sides, each easy to misread alone:

  • typecheckTS2307: Cannot find module 'minimark/stringify'
  • testone file failed with zero failed tests — the shape of an import error, in the vue project

Declared as minimark: ^0.2.0, the range docs already uses. The package was in the tree already, so the lockfile gains three lines (the importer entry) and resolves nothing new. dep-parity.json needs no reconciliation: it compares only packages both trees declare in the same section, and upstream declares minimark under docs.

Verification

lint · typecheck · build (3.86 MB) · test342 files, 7838 passed, 6 skipped · test:module · install --frozen-lockfile.

docs:generate was run separately against these changes — it is where the /raw and llms.txt numbers above come from.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JS8ypVfQSFzYVZzkTHhURb


Generated by Claude Code

Ports `12722057`, partially. Its subject is upstream's agent-discovery surface,
which this fork deliberately does not have — `9ef3ee39` built it and `ae243116`
refactored it into `nuxt-agent-discovery`, both recorded as skips — so the reflex
answer was a third skip. Reading the diff rather than the subject splits it: half
is that module, and half fixes two defects in `minimark/stringify`, which this
fork uses through the same call in `docs/server/routes/raw/[...slug].md.get.ts`.

Both defects were measured against our own installed minimark, not inferred. A
`table` node comes out as a literal `<table>` block, the format having no
pipe-table handler. And the `pre` handler always opens a three-backtick fence, so
code carrying fences of its own has its block closed early by the inner pair —
the rest becomes prose plus a second block. Not hypothetical: `docs/content/`
carries markdown tables in 28 files and four-backtick fences in 7, and all of it
reaches `/raw/**.md`, which is what our own skill references link to.

`docs/server/utils/markdown.ts` is taken as upstream wrote it. The two passes are
written against our `transformMDC.ts` rather than applied as a patch, ours being
1202 lines and diverging in its core. They run *after* `processLinks`, and here
the order is load-bearing in a way it is not upstream: upstream absolutises links
in the stringified document, ours rewrites `a.href` on the tree, and `pipeTable`
flattens an `a` node into text. Render the tables first and those hrefs are
strings before anything rewrites them.

The `llms.txt` half turned up a gap of our own. Widening the filters is not
cosmetic — `/docs/components/%` excludes the section's own index page, so the
listing carried 120 component pages and not the page introducing them (120 → 121
across a regenerate). And we had no Typography section at all: 20 pages matched
none of the four, so the prose components were absent from `llms.txt` entirely.

Not taken: the `nuxt-agent-discovery` bump, the `prerenderRoutes()` deletions
that depend on the module serving those routes, and a `minimumReleaseAgeExclude`
entry for a package this fork does not install.

Twelve tests run against the real `stringify`, two of them asserting the premise
so the workaround is reported as dead weight if minimark ever grows a table
handler. Five mutations verified. They also needed `minimark` declared at the
root — the gate caught that from two sides, `TS2307` and one test file failing
with zero failed tests.

Gate: lint, typecheck, build (3.86 MB), test (342 files, 7838 passed),
test:module, install --frozen-lockfile. docs:generate verified separately.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JS8ypVfQSFzYVZzkTHhURb
@IgorShevchik
IgorShevchik merged commit 19fe6cd into main Sep 4, 2026
2 checks passed
@IgorShevchik
IgorShevchik deleted the sync/nuxt-12722057 branch September 4, 2026 12:10
IgorShevchik added a commit that referenced this pull request Sep 4, 2026
`12722057` went in with `pending-merge` in both `pr` and `b24ui_sha`, because
the entry is written in the same commit as the port. #534 squash-merged as
`19fe6cdf`; this points it there.

Bookkeeping only — no entry is added, the cursor does not move, and no decision
changes. The cursor is `12722057`, which is nuxt/ui v4 HEAD, so the sync is
caught up and no entry carries the placeholder.
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.

2 participants