This is the Teal Pages Template Preprocessor, a modification of the Lua Pages Template Preprocessor to enable the Teal language, a typed dialect of Lua, instead of Lua directly from within <?teal
and <?
tags in script files ending with .tlp extension.
Currently it can be used from within Lua scripts or Apache mod_lua if you enable tlp_handler.lua through the LuaMapHandler directive (as explained below).
Teal Pages is a beta, experimental merge of slightly modified parts of tl's compiler and a modified lp.lua. All input, feedback and contributions are highly appreciated.
- Edit the Apache httpd.conf file and uncomment:
LoadModule lua_module modules/mod_lua.so
- Add:
LuaMapHandler "\.tlp$" "path/to/lua/teal-pages/tlp_handler.lua" handle_tlp
Done! You can start using <?teal
or simply <?
in .tlp files.
Currently script transpilation errors are not yet printed through the handler, so you must check the Apache's errors.log. Error handling can still evolve a lot.
With Apache HTTPd <2.4.9, the FallbackResource directive should preferably not be used in the active virtual host, as it invalidates the LuaMapHandler directive.
See test.tlp. Make sure testlib.tl is within the Lua libraries search path.
Teal Pages is licensed under the MIT license
(c) Felipe Daragon, exluna.org, 2020