Skip to content

Commit

Permalink
refactoring kind/dataset preparation
Browse files Browse the repository at this point in the history
  • Loading branch information
daslu committed May 24, 2024
1 parent 3f223d9 commit 0d40d12
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions src/scicloj/clay/v2/item.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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"})))
9 changes: 2 additions & 7 deletions src/scicloj/clay/v2/prepare.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0d40d12

Please sign in to comment.