Skip to content

Commit

Permalink
Merge pull request #61 from behrica/cliRenderOptions
Browse files Browse the repository at this point in the history
allow to specify options for cli render
  • Loading branch information
daslu committed Aug 16, 2021
2 parents 9c8186f + e0ac819 commit b5e5005
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/notespace/cli.clj
Expand Up @@ -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))))

0 comments on commit b5e5005

Please sign in to comment.