diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-03-19 02:26:09 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-03-19 02:26:09 +0100 |
commit | 2d26f2e4e33e16559bc337c434ba255ad4ce96aa (patch) | |
tree | a8d87625a2544c9f4d1e32604a450c6c72b06677 /module/entry-points | |
parent | Start implementing html table output. (diff) | |
download | calp-2d26f2e4e33e16559bc337c434ba255ad4ce96aa.tar.gz calp-2d26f2e4e33e16559bc337c434ba255ad4ce96aa.tar.xz |
Rewamp HTML-main to allow for more styles.
Diffstat (limited to '')
-rw-r--r-- | module/entry-points/html.scm | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/module/entry-points/html.scm b/module/entry-points/html.scm index 55fb0c94..d5f21233 100644 --- a/module/entry-points/html.scm +++ b/module/entry-points/html.scm @@ -13,11 +13,12 @@ (define opt-spec - '((from (value #t) (single-char #\F)) + `((from (value #t) (single-char #\F)) (to (value #t) (single-char #\T)) (file (value #t) (single-char #\f)) (count (value #t)) - (chunked))) + (style (value #t) (predicate ,(lambda (v) (memv (string->symbol v) + '(wide unchunked table))))))) (define (main args) (define opts (getopt-long args opt-spec)) @@ -26,7 +27,9 @@ (define end (cond [(option-ref opts 'to #f) => parse-freeform-date] [else (date+ start (date month: 1)) ])) - (define count (and=> (option-ref opts 'count "12") string->number)) + (define count (string->number (option-ref opts 'count "12"))) + + (define style (string->symbol (option-ref opts 'style "wide"))) (define-values (calendars events) (load-calendars @@ -36,6 +39,12 @@ (report-time! "Calendars loaded") - (if (option-ref opts 'chunked #f) - (html-chunked-main count calendars events start) - (html-generate calendars events start end render-calendar))) + (case style + [(unchunked) + (html-generate calendars events start end render-calendar)] + [(wide) ; previously `chunked' + (html-chunked-main count calendars events start)] + [(table) + (html-table-main count calendars events start)] + [else + (error "Unknown html style: ~a" style)])) |