Expand description
Per-page error detection for server/GUI mode.
Validates the problems a reader might care about for a single rendered page:
- Broken internal links — reuse
OutboundLinkdata fromLinkCacheand resolve each throughpath_resolver::resolve_request_path. - Broken media references — parse rendered HTML for
<img>,<video>,<audio>, and<source>tags (plus Reveal.jsdata-background-*URLs on<section>) and confirm internalsrcattributes resolve when interpreted the way a browser would: relative to the page’s canonical URL, then through the same request pipeline the server uses. Checking never duplicates resolution logic, so it cannot disagree with what a live request actually serves. - Unresolved wikilinks — literal
[[...]]substrings that escapedtransform_wikilinks(seesrc/wikilink.rs). Skipped inside<code>and<pre>blocks. - Frontmatter parse errors — a YAML error discards the whole block, so otherwise-valid fields vanish; the captured message is surfaced verbatim.
- Relationship data problems — hierarchical (parent/child) cycles and
endpoints that resolved through a name shared by several notes. Both are
detected once per index rebuild (see
src/relationships.rs) and only looked up here. - Ambiguous body wikilinks — a
[[Name]]several notes answer to, detected during the render (seesrc/wikilink_index.rs).
Designed to be cheap: each validator is a pure function and is expected to
run on-demand for a single page render. The module is never invoked from
src/build.rs, keeping static-site output untouched.
Structs§
- Media
Reference - A media reference in the rendered HTML that resolves to a real file on disk.
- Page
Errors - Response payload for
GET /{page}/errors.json.
Enums§
- Media
Kind - Type of media element whose
srcattribute is broken. - Page
Error - A single problem detected on a page.
Functions§
- ambiguous_
relationship_ endpoint_ errors - Wraps the ambiguous relationship endpoints a page declared (from
crate::relationships::RelationshipIndex::ambiguous_endpoints_for) into the page-error list. - ambiguous_
wikilink_ errors - Wraps the ambiguous body wikilinks found while rendering a page (from
crate::markdown::MarkdownRenderResult::ambiguous_wikilinks) into the page-error list. - collect_
media_ references - Resolves every internal media reference in
htmlto the file the server would actually serve, dropping the ones that do not resolve to a static file (those are already reported byvalidate_media_references). - contact_
problem_ errors - Wraps the unreadable contact-field entries found while parsing a contact
note (from
crate::markdown::MarkdownRenderResult::contact) into the page-error list. - detect_
unresolved_ wikilinks - Detects literal
[[...]]strings left in the rendered HTML by failed wikilink transformation. - frontmatter_
parse_ errors - Wraps a captured YAML frontmatter parse error (from
crate::markdown::MarkdownRenderResult::frontmatter_error) into the page-error list. Returns an empty vec when there was no error. - relationship_
cycle_ errors - Wraps the hierarchical relationship cycles a page is a member of (from
crate::relationships::RelationshipIndex::cycles_for) into the page-error list. - validate_
internal_ links - Validates the internal outbound links for a single page.
- validate_
media_ references - Validates
<img>,<video>,<audio>and<source>srcattributes in the rendered HTML. - validate_
rendered_ links - Validates every
<a href>in the page’s rendered HTML.