httk.serve.web.templating.base

Define template render inputs and the engine protocol.

Classes

TemplateRenderInput

Carry page content and context into a template engine.

TemplateEngine

Define the page and fragment template-engine protocol.

Module Contents

class httk.serve.web.templating.base.TemplateRenderInput

Carry page content and context into a template engine.

Parameters:
  • content_html – Rendered page HTML supplied to the template.

  • template_name – Optional content template name.

  • base_template_name – Optional base template name.

  • context – Values exposed to templates.

content_html: str
template_name: str | None
base_template_name: str | None
context: dict[str, object]
class httk.serve.web.templating.base.TemplateEngine

Bases: Protocol

Define the page and fragment template-engine protocol.

render(render_input)

Render page content through the configured templates.

render_fragment(*, template_name, context)

Render one optional fragment template.