Closes #92.
What changed
Both link failures in resolveLink named the destination and nothing else:
error: Markdown link has no documentation source: ./missing-one.mdThe destination is the half the reader already knows, because it is the part that is missing. The file holding the link is what has to be edited, and it was not in the message, so acting on it meant grepping the repository for the string.
The throw site already had the answer. resolveLink reads page.sourceFile on the line
above, to resolve the destination it then rejects, so nothing new is threaded through:
error: guides/start.md: Markdown link has no documentation source: ../adr/absent.mdRelative to the documentation root, because an absolute temporary path is noise in a
build log. The same applies to Markdown link has no rendered page, which had the same
shape.
Includes
Named file is the included one rather than its host. rewriteMarkdownSourceLinks hands
resolveLink the innermost origin on its include stack, so page.sourceFile is already
where the link was written. The two differ exactly when the message matters most, so
there is a test for it.
Tests
Two, in test/markdown-source-links.test.ts beside the existing coverage for this area.
Both were run against the unpatched source first and fail there:
Expected substring: "guides/start.md: Markdown link has no documentation source: ../adr/absent.md"
Received message: "Markdown link has no documentation source: ../adr/absent.md"Full suite: 612 pass, 0 fail. Lint is unchanged at 3 pre-existing warnings in README.md
and serve.ts, identical before and after. tsc --noEmit is clean.
Not in this change
#93, the build stopping at the first unresolvable link so N of them cost N builds. That one needs failures collected across the render and reported together, which is a larger change than this message fix and is better judged on its own.
🤖 Generated with Claude Code