Skip to main content

HTML-Page Generator

Project description

HTML Generator

Library for generating HTML pages. Supports adding headers, CSS and JS files, and content tags.

Installation

Install the library via pip:

pip install htmlgenim

Usage

from htmlgenim.generator import HTML, Table

# Creating an HTML Instance
page = HTML()

# Setting the title
page.set_title("My page")

# Adding CSS files
page.css_link_add("styles.css")
# page.css_link_add("https://example.com/styles.css")

# Adding JS files
page.js_link_add("script.js")
# page.js_link_add("https://example.com/script.js")

# Adding elements with attributes
page.add_element("h1", "Hello World!", class_="header", id="main-header")
page.add_element("p", "This is an example of using an HTML generator.", class_="content")
page.add_element("a", "Link to Example", href="https://example.com", class_="link")
page.add_element("input", type="radio", name="season", id="spring", value="Spring")
page.add_element("img", src="image.jpg", alt="Description of the image", class_="image")

# Create a table
table = Table()
table.add_class("my-table")
table.add_attr("border", "1")
table.add_row(["Cell 1", "Cell 2"])
table.add_row(["Cell 3", "Cell 4"])
page.table_add(table)

# Saving HTML to a file
page.save_to_file("output.html")

Upgrade

  1. Ability to add a table.
  2. You can specify CSS styles and other attributes to tags.
  3. A log file is created that displays page generation information.

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

htmlgenim-0.4.6.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

htmlgenim-0.4.6-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file htmlgenim-0.4.6.tar.gz.

File metadata

  • Download URL: htmlgenim-0.4.6.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for htmlgenim-0.4.6.tar.gz
Algorithm Hash digest
SHA256 86cafc852aef93c24d619750db3266fbd82a7a9580800a00b63ea57f66765d83
MD5 99e34b5f70c8241ac96e6b20e3ce21e4
BLAKE2b-256 37f9c9e7cf0b753011714d4acf45c36e46a00f164c20c811e373de7c3c7bb6c4

See more details on using hashes here.

File details

Details for the file htmlgenim-0.4.6-py3-none-any.whl.

File metadata

  • Download URL: htmlgenim-0.4.6-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for htmlgenim-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9e1c2aac2d432021e6fa14fb586a9689a1b4e04e23114b8ec2ddc8fb1c5c8e1d
MD5 79b04aaa8f37890918f5d7f4d6ca5c72
BLAKE2b-256 7082a8c56e41b889d319c3e8d4657f2fd686bb1584fec84f61edb9098f0ab317

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