Skip to main content

Helper functions for generating HTML documents.

Project description

htmlfun.py Helper functions for generating HTML documents.

Usage:

>>> from htmlfun.elements import html, body, h1
>>> from htmlfun import build_doc
>>> content = body(h1({"class": "header"}, "Hello, world!"))
>>> doc = build_doc(content)
>>> print(doc)

HTML elements are represented as nested lists of strings. These lists can be flattened using the flatten() core function and joined together into an html document. The build_doc() helper function is a wrapper around flatten() that wraps your tags in an HTML5 declaration and a root <html> tag pair.

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

htmlfun-0.1.0.tar.gz (11.5 kB view details)

Uploaded Source

File details

Details for the file htmlfun-0.1.0.tar.gz.

File metadata

  • Download URL: htmlfun-0.1.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for htmlfun-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b440ab51c466be57caecd44973d4023bdcf0a86a7bce5963977a3ec2791bd902
MD5 7ab80e8545e77657634678a646191df0
BLAKE2b-256 7ed54084a96b0f8182563782e2bfdf07d8337a36c1f17f4931ac8b762e2690d2

See more details on using hashes here.

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