Index

joshstock.in / 29e3f47

Source for serving and static templating/compiling of https://joshstock.in.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
9612 Dec 2020 20:23009440aUpdate lua-gitwebJosh Stockin1350G

Blob @ joshstock.in / lua-gitweb / utils / builder.lua

text/plain522 bytesdownload raw
1-- builder.lua
2-- HTML builder class
3
4-- Copyright (c) 2020 Joshua 'joshuas3' Stockin
5-- <https://joshstock.in>
6
7local _M = {}
8_M.__index = _M
9
10function _M:new()
11 local o = {}
12 o.title = ""
13 o.meta_tags = {}
14 o.body = ""
15 setmetatable(o, self)
16 return o
17end
18
19function _M:set_title(str)
20 self.title = str
21end
22
23function _M:add(str)
24 self.body = self.body..str.."\n"
25end
26
27function _M:meta(tag)
28 table.insert(self.meta_tags, tag)
29end
30
31function _M:build() -- TODO
32 return self.body
33end
34
35return _M
36