Skip to main content

Module html

Module html 

Source
Expand description

Markup that cannot be unescaped by accident. There is no template engine here and no template string: a page is a tree of El values, and the only way text reaches the output is through a method that escapes it.

The Cockpit renders what the repository holds — rule bodies, prompt text, ADR prose, file paths, a peer’s announced intent — and every one of those is content this process did not write. A template string with a {} in it puts the escaping decision at every call site; this puts it in one place, and a page that wants raw markup has to say El::raw and be read for it.

Structs§

El
An element under construction. Every builder method takes and returns self, so a page reads as one expression.

Enums§

Node
One node of a page: an element with attributes and children, or a piece of text.

Functions§

document
A whole page: the doctype, the head this Cockpit always emits, and a body.
document_on
A whole page whose root element carries root’s attributes besides its language: the theme contract, where a script written for the site reads it from <html> as the site’s pages carry it.
el
An element with this tag.
empty
Nothing. For a conditional branch that renders no element.
escape
Escape text for an element body or an attribute value. The five characters that can leave either context are replaced; nothing else is touched, so UTF-8 stays UTF-8.
raw
Markup this process produced itself: an inlined SVG icon, a fragment already rendered by another function here. Never repository content, never a request parameter.
text
A text node.