Skip to main content

T-HTML renderer for PEP 750 template strings

Project description

thtml-tstring

Higher-level T-HTML renderer for PEP 750 template strings.

from thtml_tstring import component, thtml

@component
def Button(*, children: str, kind: str = "primary"):
    classes = [kind]
    return t'<button class="{classes}">{children}</button>'

label = "Save"
page = thtml(t"<Button kind='primary'>{label}</Button>", registry={"Button": Button})
assert page.render() == '<button class="primary">Save</button>'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thtml_tstring-0.2.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

thtml_tstring-0.2.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file thtml_tstring-0.2.1.tar.gz.

File metadata

  • Download URL: thtml_tstring-0.2.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for thtml_tstring-0.2.1.tar.gz
Algorithm Hash digest
SHA256 986521198f942e9867fcf5c45b7251fe7963e48597301997b21c7330ee1cef2f
MD5 4f249ca690dc039add2726f2e1ed4609
BLAKE2b-256 0e100c5860bd52cadc3220aad1a19e5d70bada6c6f8b86f6c6cfb71e5178e843

See more details on using hashes here.

Provenance

The following attestation bundles were made for thtml_tstring-0.2.1.tar.gz:

Publisher: publish-python.yml on koxudaxi/tstring-html

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file thtml_tstring-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: thtml_tstring-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for thtml_tstring-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1736722815c9096512e5111df52b68546ceb18fe6f83148952474998c5e7b2df
MD5 1537ffb77819e5e42436ae88bbe4e309
BLAKE2b-256 cfb032c93c2b36dfdcc7fa2292ea3ad68578cf295385269871e7fe787720a94e

See more details on using hashes here.

Provenance

The following attestation bundles were made for thtml_tstring-0.2.1-py3-none-any.whl:

Publisher: publish-python.yml on koxudaxi/tstring-html

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page