betty.jinja2.globals 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.jinja2.globals module

Provide Betty’s default Jinja2 globals.

class betty.jinja2.globals.HtmlId

  Bases: `object`

  Generate unique HTML IDs.

  __init__()
  increment() → None

    Increment the ID counter.

betty.jinja2.globals.generate_html_id(context: Context) → str

  Generate an HTML ID unique within the current render call.