ReviewOS

also looking at this

stacks/bunpress

fix: resolve documentation source links in native rendering

#87
Merged chris wants to merge codex/docs-source-links into main
7 files +958 -254
docs/guide/markdown-features.mdmodified+48-0
Changes to docs/guide/markdown-features.md
@@ -294,6 +294,20 @@ Content here...
294294<!--@include: ./shared/footer.md-->
295295```
296296
297Put each include directive on its own line. Include paths are relative to the
298documentation root. Links inside included content resolve from that included
299file's directory, including recursive includes, while keeping the rendered
300page's locale. Inline includes are refused because their source boundaries
301cannot be preserved reliably through Markdown parsing.
302
303Use inline links in documents that expand includes. Reference definitions can
304bind uses across file boundaries, and the Markdown parser does not expose the
305definition's source location. These documents refuse reference definitions;
306literal examples in code spans, fenced blocks and HTML code remain supported.
307Reference validation is bounded to 256 candidate labels per expanded document.
308Split a document that exceeds this limit. Documents without includes continue
309to support reference-style links.
310
297311## Images
298312
299313### Basic Images
@@ -310,6 +324,40 @@ Content here...
310324
311325Images are automatically lazy-loaded for better performance.
312326
327## Documentation Links
328
329Use source-relative Markdown links so authored files also work on GitHub:
330
331```markdown
332[Overview](../overview.md#configuration)
333[This section](index.md)
334[Reference](README.md)
335[Named reference][guide]
336
337[guide]: ../guide.md?example=1#setup
338```
339
340Native builds and dev serving map these destinations to the generated page
341routes and apply the configured base path. For example, a page in `docs/guide/`
342linking to `../overview.md` becomes `/overview`, or `/docs/overview` with
343`basePath: '/docs'`. `index.md` uses its directory route; `README.md` keeps a
344`README` route. Query strings and fragments stay attached to the destination.
345
346Unqualified sources use the current rendered locale, including fallback
347content. An explicit language suffix such as `guide.en.md` selects that language
348even when the referring page uses another locale.
349
350External URLs, image destinations, links outside the documentation source tree,
351and literal code examples stay unchanged. Use explicit repository URLs for
352source and evidence references that should open on GitHub.
353
354A missing linked Markdown source or two sources sharing one output route
355refuses the build. A failed rebuild keeps the previous complete output. Builds
356in one process queue for the same output; another process holding that output's
357lock causes a clear refusal. Before manually removing a stale `.bunpress.lock`
358directory, inspect its `owner.json` and verify that the recorded builder has
359stopped.
360
313361## External Links
314362
315363External links automatically: