plates-render 0.7.3

The document-to-HTML half of plates: what a published page looks like.
Documentation
[package]
name = "plates-render"
description = "The document-to-HTML half of plates: what a published page looks like."
version.workspace = true
edition.workspace = true
rust-version.workspace = true
repository.workspace = true
homepage.workspace = true
license.workspace = true
readme = "README.md"
keywords = ["static-site-gen", "markdown", "djot", "html", "prov"]
categories = ["web-programming", "text-processing"]

# Portable by contract, not by luck: this crate must keep compiling for
# `wasm32-unknown-unknown`, so it holds no filesystem, no host functions, no
# entropy and no clock. A caller that has those reads the files and passes the
# bytes in. The `wasm` CI job is what enforces it.

[features]
default = ["yaml"]

# Metadata formats, forwarded to prov, which forwards to fig. With a format off,
# its parser is left out of the build *and* prov stops recognizing it — so at
# least one has to be on.
yaml = ["prov/yaml"]
json = ["prov/json"]
toml = ["prov/toml"]
fig-lang = ["prov/fig-lang"]

# Render-time body templating: the directive vocabulary (`:::each`, `:::if`,
# `:val`) and the context it resolves against, plus the whole-site entry point.
# Off by default so a consumer that only needs markdown/HTML/nav does not carry
# a context assembler it will not call. It pulls in no template *engine* — the
# structure is twig's directives, which this crate already parses for
# visibility, and the values are a path lookup over `serde_json`.
templating = ["dep:serde_json", "dep:indexmap"]

# Syntax highlighting for fenced code blocks, via syntect. Off by default for
# the same reason `templating` is, and more so: the grammars travel as an
# embedded binary dump of about a megabyte, which a consumer that only needs
# markdown/HTML/nav should not carry.
syntax-highlighting = ["dep:syntect", "dep:two-face"]

[dependencies]
prov = { workspace = true }
fig = { workspace = true }
base64 = "0.22"
serde_json = { workspace = true, optional = true }
indexmap = { workspace = true, optional = true }
# `regex-fancy`, never the default `regex-onig`: oniguruma is a C library, and
# this crate has to keep compiling for `wasm32-unknown-unknown` — the `wasm` CI
# job passes `--all-features`, so the default would take that job down the day
# this feature landed.
#
# `default-syntaxes` is off because `two-face` below supersedes it, and
# `default-themes` because the output is classed rather than styled inline: the
# colours come from `html_format_css.css`, so syntect's own themes are never
# consulted. `plist-load` stays off with them — it reads Sublime themes, which
# for the same reason nothing here loads.
#
# `yaml-load` is the exception, and it is deliberate: it is what parses a
# `.sublime-syntax` from a **string**, which is how a site adds a grammar this
# dump does not carry without this crate ever opening a file.
syntect = { version = "5.3", default-features = false, features = [
    "parsing",
    "html",
    "regex-fancy",
    "yaml-load",
], optional = true }
# The grammars themselves, as bat packages them. syntect's own bundle is 75
# syntaxes and has no Zig, Swift, TOML or TypeScript — the first two being what
# half this organisation is written in, and the third what every manifest in
# this workspace is. two-face carries 213, including all four, as the same kind
# of embedded dump for about 580 KB more. `syntect-fancy` rather than any
# `-onig` spelling, for the reason above.
two-face = { version = "0.5", default-features = false, features = [
    "syntect-fancy",
], optional = true }