Index

resty-gitweb / c69d6c0

A git web interface for Lua/OpenResty (you're on it right now!)

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
315 Dec 2020 18:527890389Update copyright noticesJosh Stockin132G

Blob @ resty-gitweb / utils / builder.lua

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