betty.html module

Provide the HTML API, for generating HTML pages.

class betty.html.Breadcrumbs[source]

Bases: Dumpable

A trail of navigational breadcrumbs.

__init__()[source]
append(label: str, url: str) None[source]

Append a breadcrumb to the trail.

dump() bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump][source]

Produce a serialized data dump of self.

class betty.html.Citer[source]

Bases: object

Track citations when they are first used.

__init__()[source]
cite(citation: Citation) int[source]

Reference a citation.

Returns:

The citation’s sequential reference number.

class betty.html.CssProvider[source]

Bases: ABC

Provide CSS for HTML pages.

abstract property public_css_paths: Sequence[str]

The public URL paths to the CSS files to include in each HTML page.

class betty.html.JsProvider[source]

Bases: ABC

Provide JavaScript for HTML pages.

abstract property public_js_paths: Sequence[str]

The public URL paths to the JavaScript files to include in each HTML page.

Bases: Link

A navigation link.

__init__(url: str, label: Localizable)[source]
property label: Localizable

The human-readable short link label.

property url: str

The absolute URL the link points to.

class betty.html.NavigationLinkProvider[source]

Bases: object

Provide navigation links for HTML pages.

The primary navigation links.

The secondary navigation links.