diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2019-05-07 11:46:37 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@hornquist.se> | 2019-05-07 11:48:44 +0200 |
commit | 528347ff3b4509056bcd29bf8b52beb23a367a0e (patch) | |
tree | 0849b81eba0375eb8b817115447d17412a4020d1 /module/output | |
parent | Add preliminary use-modules* form. (diff) | |
download | calp-server.tar.gz calp-server.tar.xz |
Add basic server.server
Diffstat (limited to 'module/output')
-rw-r--r-- | module/output/html.scm | 19 |
1 files changed, 12 insertions, 7 deletions
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 "<!doctype HTML>") (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)) + + |