From 528347ff3b4509056bcd29bf8b52beb23a367a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 7 May 2019 11:46:37 +0200 Subject: Add basic server. --- module/output/html.scm | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'module/output') diff --git a/module/output/html.scm b/module/output/html.scm index 0c8c3eb3..0e6f0813 100644 --- a/module/output/html.scm +++ b/module/output/html.scm @@ -211,17 +211,12 @@ (cons `(tr ,@w) (recur rest))))))))) -(define-public (html-main calendars events args) - - (define opts (getopt-long args opt-spec)) - - (define start (parse-freeform-date (option-ref opts 'from "2019-04-15"))) - (define end (parse-freeform-date (option-ref opts 'to "2019-05-10"))) - +(define-public (html-generate calendars events start end) (define evs (get-groups-between (group-stream events) start end)) ;; (display "") (newline) + ((@ (sxml simple) sxml->xml) `(html (@ (lang sv)) (head @@ -255,3 +250,13 @@ (current-date)))) (div (@ (class "eventlist")) ,@(stream->list (stream-map fmt-day evs))))))))) + +(define-public (html-main calendars events args) + (define opts (getopt-long args opt-spec)) + (define start (parse-freeform-date (option-ref opts 'from "2019-04-15"))) + (define end (parse-freeform-date (option-ref opts 'to "2019-05-10"))) + + + (html-generate calendars events start end)) + + -- cgit v1.2.3