Skip to content

Commit

Permalink
doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
daslu committed Sep 14, 2024
1 parent 082e7ab commit 76eaec6
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions notebooks/index.clj
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,11 @@

;; (experimental)

;; `kindly/merge-options!` varies the options to affect the notes coming below.
;; Let us use it to present code and value horizontally.
;; By default, calls to `kindly/merge-options!` are hidden.
;; In this document, we use `#(kindly/hide-code % false)` to make them visible.`

(kindly/hide-code
(kindly/merge-options! {:code-and-value :horizontal})
false)
Expand All @@ -650,6 +655,8 @@

(+ 3 4)

;; Let us change it back.

(kindly/hide-code
(kindly/merge-options! {:code-and-value :vertical})
false)
Expand All @@ -658,6 +665,8 @@

(+ 3 4)

;; Let us now change the background color.

(kindly/hide-code
(kindly/merge-options! {:style {:background-color "#ccddee"}})
false)
Expand All @@ -666,22 +675,23 @@
[:div
[:p "hello"]])

;; In Quarto-based rendering, datasets are rendered as plain Markdown,
;; and HTML options are not applied at the moment.

(tc/dataset {:x (range 3)})

;; To make sure the background color is applied, we wrap it with Hiccup.

(kind/hiccup
[:div
(tc/dataset {:x (range 3)})])

;; Let us cancel the setting of the background color.

(kindly/hide-code
(kindly/merge-options! {:style {:background-color nil}})
false)

(kind/hiccup
[:div
[:p "hello"]])

(tc/dataset {:x (range 3)})

(kind/hiccup
[:div
(tc/dataset {:x (range 3)})])

0 comments on commit 76eaec6

Please sign in to comment.