From e0ac819989e2952f6e3cff5b9cdec5a9447814d3 Mon Sep 17 00:00:00 2001 From: Carsten Behring Date: Mon, 14 Jun 2021 23:22:03 +0200 Subject: [PATCH] allow to specify options for render --- src/notespace/cli.clj | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/notespace/cli.clj b/src/notespace/cli.clj index 0d28e85..f2c8f2a 100644 --- a/src/notespace/cli.clj +++ b/src/notespace/cli.clj @@ -18,17 +18,21 @@ (defn eval-and-render-a-notespace [options] - (let [ns-symbol (:ns options)] + (let [ns-symbol (:ns options) + config-updates (:config-updates options)] (eval (find-ns-declr ns-symbol)) (in-ns ns-symbol) (api/init) + (notespace.api/update-config + #(merge % config-updates)) + (api/update-config #(assoc % :evaluation-callback-fn (fn [idx note-count note] (let [expected-duration (or (get-in note [:duration]) 0)] (println "evaluate note: " idx "/" (dec note-count)))))) (api/eval-and-realize-this-notespace) - (api/render-static-html) - ) - ) + (if-let [output-file (:output-file options)] + (api/render-static-html output-file) + (api/render-static-html))))