httk.serve.web.model.page

Define immutable route, render, and publication result models.

Classes

ResolvedRoute

Describe how a requested route was resolved.

PageResult

Carry one rendered page response and its publication metadata.

PublishReport

Report files written and warnings collected during publication.

Module Contents

class httk.serve.web.model.page.ResolvedRoute

Describe how a requested route was resolved.

Parameters:
  • kind – Resolution kind: static, content, or missing.

  • route – Normalized route text.

  • source_path – Matching source path when one exists.

kind: Literal['static', 'content', 'missing']
route: str
source_path: pathlib.Path | None = None
class httk.serve.web.model.page.PageResult

Carry one rendered page response and its publication metadata.

Parameters:
  • status_code – HTTP status code for the rendered page.

  • content_type – Response content type.

  • body – Rendered response bytes.

  • metadata – Page metadata exposed to templates.

  • warnings – Non-fatal rendering warnings.

  • assets – Trusted widget assets used by the page.

status_code: int
content_type: str
body: bytes
metadata: dict[str, object]
warnings: list[str] = []
assets: tuple[httk.serve.web.widgets.core.WidgetAsset, Ellipsis] = ()
class httk.serve.web.model.page.PublishReport

Report files written and warnings collected during publication.

Parameters:
  • written_files – Output files written by publication.

  • warnings – Non-fatal publication warnings.

written_files: list[pathlib.Path] = []
warnings: list[str] = []