A Lua function library to fill your tool set.
- On demand method loader
- Missing Lua functions implemented from other languages
- Some abstraction over tiny and very useful 3rd party code
On your/awful/proj/init.lua put just this:
require('lunar')
ondemand('my.awful.proj')And just create a bunch of files inside your/awful/proj folder,
like... hmmm... implode.lua
return function(t,glue)
return table.concat(t,glue)
endNow, in your works you just require "your.awful.proj" and use
any of the files inside your proj folder, like this:
local p = require("your.awful.proj")
p.concat({'just this'},'-')Templating system is prepared for use with Lua 5.3.3. Can handle different instances with different configurations, and with a sandboxed environment to control what can be accomplished from inside template.
local t = require('lunar.template'):new({
conf = {
cache = true, -- stores compiled templates,
compilePath = './cached/', -- where find compiled ones,
templatePath = './tpl/', -- where find templates,
}
})
local html = t:render('index.html', { t = "title", c="content" })
print html;
Example index.html
<h1>{%= t %}</h1>
{% if c then %}
<p>{%= c %}</p>
{% end %}
<footer>{%include: footer.html %}</footer>Below, a list with 3rd party snippets mixed in Aurora code. Some of these were changed and adapted.
- Template: build upon SLT (https://github.com/henix/slt2)
- HTTP Server: using Pegasus