scicloj / clay

A tiny Clojure tool for dynamic workflow of data visualization and literate programming
https://scicloj.github.io/clay/
Eclipse Public License 1.0
111 stars 10 forks source link

kind/code problems #103

Open genmeblog opened 3 weeks ago

genmeblog commented 3 weeks ago

Hi! I see two issues regarding interpretation of code blocks by clay.

First: only strings are accepted. I propose acceptation of anything (but sequence) and applying str on content. Second: only vectors are accepted for multiple code snippets, should be changed to any sequential (here).

(kind/code 1.222)
;; exception
(kind/code "1.222")
;; ok
(kind/code ["1.22" "3.33"])
;; ok
(kind/code (list "1.22" "3.33"))
;; exception
daslu commented 2 weeks ago

@genmeblog Thanks.

I'm wondering about your str proposal. What is your use case? (And do you maybe find kind/pprint useful in such cases?)

genmeblog commented 2 weeks ago

Actually there are three options for that and these options give different results. kind/pprint wraps the value into the vector.

image

daslu commented 2 weeks ago

Ther new version 2-beta11 supports lists as you proposed. The other parts need more discussion.