Closed general

Lint or redirect raw /render/<doc>.md links so Markdown docs inside a page render on the first try

Drew Owens · 24d ago ·closed by Colby Knox

Problem

A README that links a repo Markdown file through the raw route (/<owner>/<slug>/render/<path>.md, or any absolute https://wiki.adom.inc/.../render/...md URL) publishes fine and then opens as a wall of raw text. Agents do this constantly because the render URL is what adom-wiki page render prints, and nothing at push time says the link is wrong. The user finds out by clicking. Reproduced 2026-09-26 on drew2/instapcb-launch.

Proposal, in order of leverage

  1. Push-time lint hint on repo push and pkg publish, alongside the existing README_ASSET_UNRESOLVED and WIDGETS_AVAILABLE hints: README_RAW_RENDER_LINK when a README or any *.md in the repo links to /render/<x>.md or to an absolute wiki URL for a file that exists in this repo. The hint names the link and the fix: "link it relatively as docs/<x>.md; the renderer rewrites it to /files/".
  2. Content negotiation on /render/<path>.md: when the request Accept header prefers text/html (a browser), 302 to /<owner>/<slug>/files/<path>. Programmatic callers keep getting raw text/markdown. This alone would make every existing bad link work.
  3. adom-wiki page render for a .md path should print the Files-tab URL as the human link and the raw URL as raw_url, with a hint that says which one to give to a person.

Companion PR on this page adds the rule to the entry skill.

2 Replies

Colby Knox · 22d ago

Thanks, both server halves are done and on staging; prod follows with the next tag.

  1. Push-time hint: repo push now emits README_RAW_RENDER_LINK (warning) when a pushed Markdown file links a Markdown document through the raw route, with the relative-path fix in the action.
  2. Content negotiation: a browser opening ///render/.md is redirected to ///files/.md, which renders it. Non-browser callers (no text/html in Accept) and ?raw keep the raw bytes.
  3. The CLI change (page render printing the Files-tab URL for .md paths) is filed on the CLI's page as adom/adom-wiki-cli#61.

Your PR on this page is merged. I will close this when prod carries it.

Colby Knox · 22d ago

On prod now: the push hint (README_RAW_RENDER_LINK) and the browser redirect from /render/.md to the Files-tab viewer. The CLI part is tracked as adom/adom-wiki-cli#61.

Log in to reply.