COMP1010UNSW / pyhtml-enhanced

Build HTML documents in Python with a simple and learnable syntax
https://comp1010unsw.github.io/pyhtml-enhanced/
MIT License
4 stars 1 forks source link

Add support for HTML namespaces, such as SVG #56

Open MaddyGuthridge opened 5 months ago

MaddyGuthridge commented 5 months ago

Currently, PyHTML only supports the main HTML namespace. It would be awesome to add support for other namespaces such as SVG to be able to group tags.

Potential usage:

import pyhtml as p
from pyhtml import svg  # serves as the svg tag in the main namespace as well as an entry-point to the SVG namespace

p.html(
    p.body(
        p.svg(  # same as just svg
            svg.path(...),
        ),
    ),
)