diff --git a/deps.edn b/deps.edn index d2ab2a54..efbd5c3a 100644 --- a/deps.edn +++ b/deps.edn @@ -7,8 +7,8 @@ io.github.nextjournal/markdown {:mvn/version "0.5.148"} hiccup/hiccup {:mvn/version "2.0.0-RC3"} clj-commons/clj-yaml {:mvn/version "1.0.27"} - org.scicloj/kindly {:mvn/version "4-beta6"} - org.scicloj/kindly-advice {:mvn/version "1-beta1"} + org.scicloj/kindly {:mvn/version "4-beta7"} + org.scicloj/kindly-advice {:mvn/version "1-beta3"} org.scicloj/tempfiles {:mvn/version "1-beta1"} org.scicloj/kind-portal {:mvn/version "1-beta1"} org.clojure/tools.reader {:mvn/version "1.3.7"} diff --git a/src/scicloj/clay/v2/notebook.clj b/src/scicloj/clay/v2/notebook.clj index 65bda55b..318b219e 100644 --- a/src/scicloj/clay/v2/notebook.clj +++ b/src/scicloj/clay/v2/notebook.clj @@ -8,6 +8,7 @@ [scicloj.clay.v2.read :as read] [scicloj.clay.v2.config :as config] [scicloj.clay.v2.util.merge :as merge] + [scicloj.kindly.v4.api :as kindly] [scicloj.kindly.v4.kind :as kind] [scicloj.kindly-advice.v1.api :as kindly-advice])) @@ -201,7 +202,8 @@ format]}] (binding [*ns* *ns* *warn-on-reflection* *warn-on-reflection* - *unchecked-math* *unchecked-math*] + *unchecked-math* *unchecked-math* + kindly/*options* kindly/*options*] (let [code (some-> full-source-path slurp) notes (cond single-value (conj (when code diff --git a/src/scicloj/clay/v2/prepare.clj b/src/scicloj/clay/v2/prepare.clj index d491e5bc..6ecdbe26 100644 --- a/src/scicloj/clay/v2/prepare.clj +++ b/src/scicloj/clay/v2/prepare.clj @@ -145,11 +145,7 @@ (defn prepare [{:as context :keys [value]} {:keys [fallback-preparer]}] - (let [complete-context (-> context - (update :kindly/options - merge/deep-merge - (-> value meta :kindly/options))) - kind (-> complete-context + (let [kind (-> context advise-if-needed :kind)] (case kind @@ -174,11 +170,13 @@ (when-let [preparer (-> kind (@*kind->preparer) (or fallback-preparer))] - [(-> complete-context + [(-> context preparer - (update :hiccup limit-hiccup-height complete-context) - (update :md limit-md-height complete-context) - (assoc :kindly/options (:kindly/options complete-context)))])))) + ;; returns an item + (update :hiccup limit-hiccup-height context) + (update :md limit-md-height context) + ;; items need the options from the context + (assoc :kindly/options (:kindly/options context)))]))))