Skip to main content

Module render_html

Module render_html 

Source
Expand description

HTML fragment renderer.

Produces semantic HTML with surfdoc-* CSS classes. Markdown blocks are rendered through pulldown-cmark. All other content is HTML-escaped to prevent XSS.

Re-exports§

pub use crate::resolve::accent_ink_color;
pub use crate::resolve::contrast_ratio;

Structs§

HeadIcon
A <link rel="icon"> / apple-touch-icon entry for the page head.
HeadScript
A <script src> entry for the page head.
PageConfig
Configuration for full-page HTML rendering with SurfDoc discovery metadata.
PageEntry
A single page extracted from a ::page block.
ReadingFrame
Reading-frame chrome for long documents (papers, legal, support): a sticky toolbar with a back-link + title over a centered reading “sheet”. Set on PageConfig::reading_frame to wrap the shell page content.
SiteConfig
Extracted site-level configuration from a ::site block.

Functions§

extract_site
Extract site config and page list from a parsed SurfDoc.
humanize_route
Convert a route path to a human-readable nav label.
render_site_page
Render a full HTML page for one route within a multi-page site.
render_site_single_file
Render an entire multi-page site as a SINGLE self-contained HTML document.
to_html
to_html_fragment
Render a slice of blocks as bare HTML fragments.
to_html_page
Render a SurfDoc as a complete HTML page with SurfDoc discovery metadata.
to_shell_page
Render a full HTML page from a site shell plus pre-rendered body HTML.