1
0
Fork
You've already forked teg
0
an experimental web templating language https://paidbsd.org/teg
  • Awk 96.2%
  • CSS 3.8%
2026年06月30日 15:43:41 +03:00
extra docs changes, small tag addition, fix for escapes inside codeblocks 2026年06月30日 15:43:41 +03:00
.gitignore added a gitignore 2025年09月30日 03:37:31 +03:00
docs.teg docs changes, small tag addition, fix for escapes inside codeblocks 2026年06月30日 15:43:41 +03:00
license.txt add new contributor to license 2026年05月31日 17:52:27 +03:00
readme.md Update readme.md 2026年05月01日 16:54:38 +02:00
teg.awk docs changes, small tag addition, fix for escapes inside codeblocks 2026年06月30日 15:43:41 +03:00

teg!

teg is a something I made more of as a joke that has grown into a completely usable web templating language made entirely in AWK.

There's bugs. Mostly ones that I don't know about. Some I know of, but won't fix because that would require adding hundreds more lines of code to teg. (example: inline calls cannot contain a ! inside)

Documentation

Refer to docs.teg (convert to html using ./teg.awk docs.teg > docs.html)

How do I use this

Manually convert a .teg file into .html:

./teg.awk file.teg > output.html

Or use as CGI: (lighttpd)

cgi.assign = ( ".teg" => "/opt/teg/teg.awk" )
index-file.names = ( "index.html", "index.teg", "main.teg" )
static-file.exclude-extensions = ( ".teg" )

... and now .teg files will be automatically formatted (as long as you have teg in /opt/teg/teg.awk)

Usage as an AWK library

Since the v1.8 update, teg can be used as a library in GAWK.

Read up on the latest chapter in the docs.teg file and for an example of library usage check extra/library_use.awk

Pull requests

I would be very thankful! teg has grown to be a giant mess of a project with me just stacking whatever I need on top of what I've made before.

But please, don't be afraid! If you want to add something new, go on and do it!