htmlify

An ultra-basic, human-friendly templating system for doing CGI with Python for less 😕 and more 🎉


Keywords
CGI, python3, HTML, templates, templating
License
MIT
Install
pip install htmlify==0.1.2-beta

Documentation

htmlify

An ultra-basic, human-friendly templating system for doing CGI with Python for less 😕 and more 🎉

htmlify is powerful enough to drive small web projects, while lightweight enough that you don't feel like you're learning a whole new language. Here's how it works:

example.cgi
templates/exampleTemplate.html
exampleTemplate = Template("exampleTemplate")

exampleTemplate.getHTML( favFood="spam", favDrink="carrot juice", magicNumberOne=17, magicNumberTwo=30 )

I like to eat _%(favFood) I like to drink _%(favDrink) 2875 plus 3495 is equal to _%[2875+3495] Concatenating "hello" and " there" gives _%["hello" + " there"] Adding the magic numbers gives _%[_%(magicNumberOne)+_%(magicNumberTwo)]

The result:

http://localhost/example.cgi
I like to eat spam
I like to drink carrot juice)
2875 plus 3495 is equal to 6370
Concatenating "hello" and " there" gives hello there

Adding the magic numbers gives 47