Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Domgen

Domgen is a library which can be used to generate minified HTML, with rich custom component support and material design components as standard.

To make a basic page's HTML code:

import dom

page_model = dom.HTML(
    dom.Head(
        dom.Title("My Glorious Test Page"),
        dom.ExternalResourceLink(rel="stylesheet", href="assets/style.css")
    ),
    dom.Body(
        dom.ContentDivision(classes={"red", "centre"})(
            "My red and centred content with",
            dom.Button(onclick="alert('hello user')")(
                "a button"
            ),
            "in it",
        )
    )
)
page_code = page_model.serialise()
page_code_readable = page_model.serialise(minify=False)
<!-- page_code -->
<!DOCTYPE html><html><head><title>My Glorious Test Page</title><link rel="stylesheet" href="assets/style.css" /></head><body><div class="red centre">My red and centred content with<button onclick="alert('hello user')">a button</button>in it</div></body></html>
<!-- page_code_readable -->
<!DOCTYPE html>
<html>
    <head>
        <title>
            My Glorious Test Page
        </title>
        <link rel="stylesheet" href="assets/style.css" />
    </head>
    <body>
        <div class="red centre">
            My red and centred content with
            <button onclick="alert('hello user')">
                a button
            </button>
            in it
        </div>
    </body>
</html>

Metadata

Release files for domgen 0.4.1a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for domgen 0.4.1a0
File Size Uploaded
domgen-0.4.1a0.tar.gz 29.1 kB Details

Release files / domgen-0.4.1a0.tar.gz

Download URL domgen-0.4.1a0.tar.gz
Size 29.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d99336cde124c288d31d36708bc0c04578ce35a7222d841cb55f7796d15395d2
BLAKE2b-256 checksum
How to use checksums
d9a1fb7c404c238186cfcc36af6dd37538af373a5bdc1e8f19f73bc0c056762a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page