betty.html module - Betty documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# betty.html module

Provide the HTML API, for generating HTML pages.

class betty.html.Breadcrumbs

  Bases: `Dumpable`

  A trail of navigational breadcrumbs.

  __init__()
  append(label: str, url: str) → None

    Append a breadcrumb to the trail.

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

    Produce a serialized data dump of `self`.

class betty.html.Citer

  Bases: `object`

  Track citations when they are first used.

  __init__()
  cite(citation: Citation) → int

    Reference a citation.

    Returns:

      The citation’s sequential reference number.

class betty.html.CssProvider

  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

  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.

final class betty.html.NavigationLink

  Bases: `Link`

  A navigation link.

  __init__(url: str, label: Localizable)
  property label: Localizable

    The human-readable short link label.

  property url: str

    The absolute URL the link points to.

class betty.html.NavigationLinkProvider

  Bases: `object`

  Provide navigation links for HTML pages.

  primary_navigation_links() → Sequence[NavigationLink]

    The primary navigation links.

  secondary_navigation_links() → Sequence[NavigationLink]

    The secondary navigation links.