From fc439af621b3d01b288945a9c9574800a6b5d90c Mon Sep 17 00:00:00 2001 From: daslu Date: Fri, 24 May 2024 23:41:19 +0300 Subject: [PATCH] - added partial support for dataset print options as kindly options --- CHANGELOG.md | 4 ++-- src/scicloj/clay/v2/item.clj | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 164f3ba..c547d2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,8 @@ All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/). ## [2-beta10] - unreleased -- add classes to elements that have styling applied to faciliate custom styles (#102) - +- added classes to elements that have styling applied to faciliate custom styles (#102) +- added partial support for dataset print options as kindly options ## [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 e2973c5..dbd22e7 100644 --- a/src/scicloj/clay/v2/item.clj +++ b/src/scicloj/clay/v2/item.clj @@ -8,7 +8,8 @@ [scicloj.clay.v2.util.meta :as meta] [hiccup.page] [hiccup.core :as hiccup] - [clojure.string :as str])) + [clojure.string :as str] + [scicloj.kindly.v4.api :as kindly])) (def *id (atom 0)) @@ -325,9 +326,16 @@ :deps [:highcharts]}) (defn dataset [{:as context - :keys [value]}] - (-> value - println - with-out-str - md - (merge {:item-class "clay-dataset"}))) + :keys [value kindly/options]}] + (let [{:keys [dataset/default-table-row-print-length]} options + printed-string (if default-table-row-print-length + (binding [tech.v3.dataset.print/*default-table-row-print-length* default-table-row-print-length] + (-> value + println + with-out-str)) + (-> value + println + with-out-str))] + (-> printed-string + md + (merge {:item-class "clay-dataset"}))))