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.1.10.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.1.10-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: thtml_tstring-0.1.10.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.1.10.tar.gz
Algorithm Hash digest
SHA256 188114422bbca71e2d55aac2d20c051dcd6da1946e766811f2037ab354ebaab6
MD5 c4dee9c2a5d1e7d36ef46d49e114bb1b
BLAKE2b-256 88d34e3de94e7204b3788917981d8023c0c3eb1e966479f71f57d921381ffcaa

See more details on using hashes here.

Provenance

The following attestation bundles were made for thtml_tstring-0.1.10.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.1.10-py3-none-any.whl.

File metadata

  • Download URL: thtml_tstring-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 4.5 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.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 a0eb8c4076799fbecbfbdef0bc58ac1c096c8a91bedf6fe0ad2c2ee9becb2951
MD5 15ab5c4e5d754cf5ba8215fdf57b5d22
BLAKE2b-256 41c7c548e7ceb58f16d511863b9b079e333c163ac9dd54af4136868df43e124a

See more details on using hashes here.

Provenance

The following attestation bundles were made for thtml_tstring-0.1.10-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