diff options
-rw-r--r-- | tissue/web/static.scm | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/tissue/web/static.scm b/tissue/web/static.scm index 2b910cb..ad9849b 100644 --- a/tissue/web/static.scm +++ b/tissue/web/static.scm @@ -1,5 +1,5 @@ ;;; tissue --- Text based issue tracker -;;; Copyright © 2022, 2023 Arun Isaac <arunisaac@systemreboot.net> +;;; Copyright © 2022, 2023, 2025 Arun Isaac <arunisaac@systemreboot.net> ;;; ;;; This file is part of tissue. ;;; @@ -26,6 +26,7 @@ #:use-module (srfi srfi-28) #:use-module (srfi srfi-171) #:use-module (ice-9 filesystem) + #:use-module (ice-9 match) #:use-module (skribilo engine) #:use-module (skribilo evaluator) #:use-module (skribilo reader) @@ -75,12 +76,15 @@ read from and the output port to write to." get-bytevector-some in)))) -(define (engine-custom-set engine key value) - "Set custom @var{key} of @var{engine} to @var{value}. This is a purely +(define (engine-custom-set engine . key-value-pairs) + "Set custom @var{key-value-pairs} of @var{engine}. This is a purely functional setter that operates on a copy of @var{engine}. It does not mutate @var{engine}." (let ((clone (copy-engine (engine-ident engine) engine))) - (engine-custom-set! clone key value) + (for-each (match-lambda + ((key . value) + (engine-custom-set! clone key value))) + key-value-pairs) clone)) (define* (html-engine #:key css) @@ -88,11 +92,11 @@ mutate @var{engine}." @var{css} is the URI to a CSS stylesheet. If it is @code{#f}, no stylesheet is included in the generated web pages." - (if css - (engine-custom-set (find-engine 'html) - 'css - (list css)) - (find-engine 'html))) + (apply engine-custom-set + (find-engine 'html) + (if css + `((css . ,(list css))) + '()))) (define (gemtext-reader) "Return a skribilo reader for gemtext." |