local utils = require("utils") local git = require("git_commands") ngx.say("") ngx.say("
") local md2html = function(file) local formatted_command = string.format( "/usr/local/bin/md2html --github %s", file ) return utils.process(formatted_command) end print_table = function(t, l) l = l or 0 local n = 0 for i,v in pairs(t) do n = n + 1 break end if n > 0 then ngx.print("{\n") for i,v in pairs(t) do for i=0,l do ngx.print(" ") end ngx.print("",i,": ") if type(v) ~= "table" then if type(v) == "string" then ngx.print("\"") local s = v:gsub("&", "&"):gsub("<","<"):gsub(">",">") ngx.print(s) ngx.print("\"") else ngx.print(v) end else print_table(v,l+1) end ngx.print("\n") end for i=0,l-1 do ngx.print(" ") end ngx.print("}") else ngx.print("{}") end end local name = "ncurses-minesweeper" --local name = "lognestmonster" --local name = "auto-plow" --local name = "joshstock.in" local repo = "/home/josh/repos/"..name local commits_head = git.log(repo, "@", 10, 0, true) ngx.say("Terminal game of Minesweeper, implemented in C with ncurses.
") ngx.say("Log | Files | Refs | README | LICENSE
") ngx.say("Date | ") ngx.print("Hash | ") ngx.print("Subject | ") ngx.print("Author | ") ngx.print("+ | ") ngx.print("- | ") ngx.print("GPG? | ") ngx.print("|
---|---|---|---|---|---|---|---|
",utils.iso8601(commit.timestamp)," | ") ngx.print("",commit.shorthash," | ") ngx.print("",commit.subject," | ") ngx.print("",commit.author," | ") ngx.print("",commit.email," | ") ngx.print("commit.diff.minus and "green;font-weight:bold" or "inherit","\">",commit.diff.plus," | ") ngx.print("commit.diff.plus and "red;font-weight:bold" or "inherit","\">",commit.diff.minus," | ") ngx.print("",commit.gpggood," | ") ngx.say("