an html templating system thats also a good girl
Find a file
2025-10-08 02:20:43 -04:00
puppygirl errar 2025-10-08 02:20:43 -04:00
.gitignore maid time 2025-10-06 18:03:06 -04:00
pyproject.toml uhh yeag 2025-10-06 16:11:34 -04:00
README.md c# moment 2025-10-06 17:14:52 -04:00
requirements.txt initial commit 2025-10-06 05:05:27 -04:00

puppygirl

an easy to train html templating system

usage

<!-- index.html -->
 <!DOCTYPE html>
 <html lang="en">
    <head>
      <template id="pg-template">
        <slot></slot>
      </template>
    </head>
    <body>
      <puppygirl-domme template="pg-template">
        <p>rawerf :3</p>
      </puppgirl-domme>
    </body>
  </html>

cli

usage: puppygirl build [-h] [-p] [-r {client,server}] INPUT OUTPUT

positional arguments:
  INPUT
  OUTPUT

options:
  -h, --help            show this help message and exit
  -p, --pretty
  -r, --renderer {client,server}
$ puppygirl build --pretty --renderer server index.html dist/index.html

programmatically

pg = Puppygirl(
  renderer=ServerSideRenderer(),
  elements=[PuppygirlDomme]
)

# parsed using the above config
parsed = pg.fetch("index.html")

with open("dist/index.html", "w") as f:
  f.write(parsed.prettify()) # parsed is a beautifulsoup4 object