diff --git a/CHANGELOG.md b/CHANGELOG.md index 6404689..164f3ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,6 @@ All notable changes to this project will be documented in this file. This change - add classes to elements that have styling applied to faciliate custom styles (#102) - ## [2-beta9] - 2024-05-18 - extended the `kind/fn` semantics to a map spec diff --git a/src/scicloj/clay/v2/item.clj b/src/scicloj/clay/v2/item.clj index 40a20a5..e2973c5 100644 --- a/src/scicloj/clay/v2/item.clj +++ b/src/scicloj/clay/v2/item.clj @@ -323,3 +323,11 @@ "Highcharts.chart(document.currentScript.parentElement, %s);" (charred/write-json-str value))]] :deps [:highcharts]}) + +(defn dataset [{:as context + :keys [value]}] + (-> value + println + with-out-str + md + (merge {:item-class "clay-dataset"}))) diff --git a/src/scicloj/clay/v2/prepare.clj b/src/scicloj/clay/v2/prepare.clj index d9938e9..32489b4 100644 --- a/src/scicloj/clay/v2/prepare.clj +++ b/src/scicloj/clay/v2/prepare.clj @@ -241,14 +241,9 @@ (->> codes item/source-clojure))) -(add-preparer-from-value-fn! +(add-preparer! :kind/dataset - (fn [v] - (-> v - println - with-out-str - item/md - (merge {:item-class "clay-dataset"})))) + #'item/dataset) (add-preparer-from-value-fn! :kind/smile-model