Python/rattlepy

Python
#htmlを直接記入できるライブラリ
    
from rattlepy import *

h1 = "Hello, rattlepy"
h2 = "This is a html."

with html() as html:
  with head():
    with title():
      text(h1)
  with body():
    with node("h1", className="title"):
        text(h1)
    with node("h2", className="sub-title"):
        text(h2)
    with node("div", className="test-div"):
        text("test div tag")
        with node("span",  className="test-span"):
            text("test sapn tag")

print(html)