src/render.lua

changeset 0
6279a7d40ae7
child 15
3fe9cef6a187
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/render.lua	Tue Mar 09 12:16:56 2021 +0000
@@ -0,0 +1,18 @@
+local html = require "util.html";
+local json = require "util.json";
+
+html.basename = function (str)
+	return str:match("[^/]+$");
+end
+
+html.date = function (datetime)
+	return datetime:sub(1,10);
+end
+
+html.json = json.encode;
+
+local render = require"util.interpolation".new("%b{}", html.escape, html);
+
+return {
+	render = render;
+};

mercurial