blob: c3f49c1bedf82060f2eaa0f32e846930e779ce99 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
;;; utilities.lisp
(in-package :arclade)
(defun read-from-file (path)
(read-from-string
(alexandria:read-file-into-string path)))
(defvar *epoch* (encode-universal-time 0 0 0 1 1 1970)
"Jan 1 1970 Unix Epoch time in CL universal time.")
(defun format-time (time)
(multiple-value-bind (_ min hour day month year)
(decode-universal-time time)
(declare (ignore _))
(format nil "~2,'0d-~2,'0d-~a ~2,'0d:~2,'0d"
month day year hour min)))
(defmacro with-page ((&key title) &body body)
"A helper macro for defining some standard page boilerplate."
(let ((title-var (gensym)))
`(let ((,title-var ,title))
(with-html-string
(:doctype)
(:html
(:head
(:script :src "http://localhost:8080/skewer")
(:title ,title-var))
(:body
,@body))))))
|