From 6bf62f21b7028907baba669280504904cf348059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 2 Mar 2020 01:14:16 +0100 Subject: Cleanup in HTML chunked main. --- module/output/html.scm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/module/output/html.scm b/module/output/html.scm index 2b59b820..bd28b390 100644 --- a/module/output/html.scm +++ b/module/output/html.scm @@ -13,6 +13,7 @@ #:use-module (datetime util) #:use-module (output general) #:use-module (ice-9 curried-definitions) + #:use-module (ice-9 match) #:use-module (git) @@ -403,15 +404,14 @@ ;; NOTE Something here isn't thread safe. ;; TODO make it thread safe (stream-for-each - (lambda (pair) - (format (current-error-port) "d = ~a~%u = ~a~%" (car pair) (cadr pair)) - (let ((fname (format #f "./html/~a.html" (date->string (car pair) "~1")))) - (format (current-error-port) "Writing to [~a]~%" fname) - (with-output-to-file fname - (lambda () (html-generate calendars events (car pair) (cadr pair) render-calendar))))) + (match-lambda + [(start-date end-date) + (let ((fname (format #f "./html/~a.html" (date->string start-date "~1")))) + (format (current-error-port) "Writing to [~a]~%" fname) + (with-output-to-file fname + (lambda () (html-generate calendars events start-date end-date render-calendar))))]) (let ((ms (month-stream start-date))) (stream-take count (stream-zip - ms (stream-map (lambda (d) (date- d (date day: 1))) ; last in month - (stream-cdr ms)))) - ))) + ms (stream-map (lambda (d) (date- d (date day: 1))) ; last in month + (stream-cdr ms))))))) -- cgit v1.2.3