summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-12-25 15:55:29 +0000
committerArun Isaac2022-12-25 23:33:04 +0000
commitdf7c2f672d5b413fb8bf5bc4811b5dff9d56c919 (patch)
tree687bf7c0b29b53ae668709f7cd7ed265a7ae9145
parent951f8cf5c1d7688784de0c9f083625f6f3f031b1 (diff)
downloadtissue-df7c2f672d5b413fb8bf5bc4811b5dff9d56c919.tar.gz
tissue-df7c2f672d5b413fb8bf5bc4811b5dff9d56c919.tar.lz
tissue-df7c2f672d5b413fb8bf5bc4811b5dff9d56c919.zip
web: static: Allow customization of engine used in export.
* tissue/web/static.scm (gemtext-exporter, skribe-exporter): Accept engine keyword argument.
-rw-r--r--tissue/web/static.scm14
1 files changed, 8 insertions, 6 deletions
diff --git a/tissue/web/static.scm b/tissue/web/static.scm
index 5346ba8..38a7d42 100644
--- a/tissue/web/static.scm
+++ b/tissue/web/static.scm
@@ -83,25 +83,27 @@ read from and the output port to write to."
;; Relax the gemtext standard by joining adjacent lines.
#:join-lines? #t))
-(define* (gemtext-exporter file #:key (reader (gemtext-reader)))
+(define* (gemtext-exporter file #:key (reader (gemtext-reader))
+ (engine (find-engine 'html)))
"Return a writer function that reads gemtext @var{file} using
-@var{reader} and exports it."
+@var{reader} and exports it using @var{engine}."
(exporter file
(lambda (in out)
(with-output-to-port out
(cut evaluate-document
(evaluate-ast-from-port in #:reader reader)
- (find-engine 'html))))))
+ engine)))))
-(define* (skribe-exporter file #:key (reader (make-reader 'skribe)))
+(define* (skribe-exporter file #:key (reader (make-reader 'skribe))
+ (engine (find-engine 'html)))
"Return a writer function that reads skribe @var{file} using
-@var{reader} and exports it."
+@var{reader} and exports it using @var{engine}."
(exporter file
(lambda (in out)
(with-output-to-port out
(cut evaluate-document
(evaluate-ast-from-port in #:reader reader)
- (find-engine 'html))))))
+ engine)))))
(define (with-current-directory directory thunk)
"Change current directory to DIRECTORY, execute THUNK and restore