httk.serve.web.widgets.optimade_fields

A server-side-static table of OPTIMADE property definitions.

Unlike optimade_table this widget performs no browser fetch and ships no JavaScript: the served schema’s property definitions are known at startup, so the table is rendered once from the properties mapping a site supplies.

Attributes

Functions

render(context, *, properties[, caption])

Render a static table of OPTIMADE property definitions.

Module Contents

httk.serve.web.widgets.optimade_fields.MAX_OPTIMADE_FIELDS = 512[source]
httk.serve.web.widgets.optimade_fields.render(context, *, properties, caption='Field definitions')[source]

Render a static table of OPTIMADE property definitions.

Each row links a property’s prefixed name to the human-readable definition page at its $id and shows the first paragraph of its description. Ad-hoc synthesized ids (whose path contains /ad-hoc/) and any non HTTP(S) id render the name as plain text rather than a link.

Parameters:
  • context (httk.serve.web.widgets.core.WidgetContext) – Immutable widget invocation context.

  • properties (object) – Mapping of served property name to its OPTIMADE property-definition mapping (each carrying $id and description).

  • caption (str) – Accessible table caption.

Returns:

Static field-definition table and its stylesheet asset.

Raises:

OptimadeTableProtocolError – If properties is not a non-empty mapping of at most 512 identifier-named definition mappings.

Return type:

httk.serve.web.widgets.core.WidgetRenderResult