Expand description
The document-to-HTML half of plates: what a page looks like.
This crate reads nothing and resolves nothing. It is handed source text and a description of the site that text belongs to, and it gives back HTML — which is what lets one rendering run in a command-line build, in a sync server, and in an edge worker without three implementations quietly disagreeing about what a site looks like.
The plates crate is the layer above: it walks a prov::Workspace,
decides which documents a site holds and where each one lands, and calls
this.
A body’s grammar is its own — Markdown, Djot or HTML, read off the source
document’s extension via prov::ContentFormat — and all three go through
one parser, twig. See body for why that is the same parser the editor
uses and what changed in the output when it stopped being comrak.
It must remain portable to wasm32-unknown-unknown, which is a constraint
rather than a preference: no host functions, no filesystem, no entropy and
no clock. A caller that has those reads the files and passes the bytes in.
Re-exports§
pub use appearance::ColorPalette;pub use appearance::ContentWidth;pub use appearance::FaviconAsset;pub use appearance::FontFamily;pub use appearance::ThemeAppearance;pub use appearance::TypographySettings;pub use body::preprocess_custom_syntax;pub use body::render_body;pub use html::Generator;pub use html::HtmlRenderer;pub use html::ISLAND_CHILD_SCRIPT;pub use html::ISLAND_CHILD_SCRIPT_FILENAME;pub use html::PageContext;pub use html::SiteStyle;pub use shell::ShellError;pub use shell::ShellSlots;pub use shell::ShellTemplate;pub use types::Arrangement;pub use types::PageLayout;pub use types::serve_at_dest;
Modules§
- appearance
- Workspace appearance types: theme colors, typography, and favicon.
- body
- Body prose → HTML, in whichever grammar the document is written in.
- dates
- Turning the dates a vault writes into the dates a feed reader will accept.
- frontmatter
- Reading the metadata block of a source document.
- html
- Full HTML document assembly: wraps rendered page bodies in the site shell (head, nav, breadcrumbs, footer, interactivity script) and produces the static CSS/favicon assets.
- nav
- Site navigation tree construction.
- page
- Page-shell helpers: navigation, breadcrumbs, SEO meta, feed/sitemap/robots generation, and small HTML/XML escaping utilities.
- shell
- The site shell as named slots, and the substitutor that fills a caller-supplied template with them.
- types
- Pure value types describing a site to be rendered.
- visibility
- Audience visibility filtering for inline and block markdown directives.
Structs§
- Grouping
- What a grouped arrangement sorts entries into groups by.
Enums§
- Grain
- What a grouped arrangement sorts entries into groups by.
Functions§
- percent_
decode - Decode percent-encoded characters in a URL string (e.g.
%20→). - root_
prefix - Compute the relative prefix to get from a page back to the site root.
- transform_
links - Rewrite internal
.mdhyperlinks in rendered HTML to their published.htmldestinations, resolving relative/workspace-root paths via thepath_to_filenamemap. External links, anchors, and non-.mdhrefs are left untouched.