Skip to main content

a minimalist python html template lib

Project description

kTemplate

ci-badge coverage-badge pypi-badge py-version MIT-badge black-badge

a minimalist python html template

Quick Start

Installation

pip install kTemplate

Examples

from kTemplate import (
  div, img, # common html elements
  element   # for creating custom element
)

# create common html element
# `class` represents by `cls` due to python keyword
html_str = div(img(src='url'), cls='bar')
# -> <div class="bar"><img src="url"/></div>

# create custom element
my_element = element(tag="MyElement", content="foo" props="bar")
# -> <MyElement props="ar">foo</MyElement>

Please refer to the docs for creating HTML templates and components

Documentation

Please refer the docs for more about:

Need Help?

Open a github issue or ping me on Twitter

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

ktemplate-0.3.2.tar.gz (7.1 kB view hashes)

Uploaded Source

Built Distribution

ktemplate-0.3.2-py3-none-any.whl (7.5 kB view hashes)

Uploaded Python 3

Supported by

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