nextjournal / clerk

⚡️ Moldable Live Programming for Clojure

Home Page:https://clerk.vision

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Case where `clerk/row` displays only the first of its arguments

teodorlu opened this issue · comments

Hi!

I have a document where

(clerk/row
 (scale ipe300 0.5)
 (scale hea300 0.5))

only displays the first value, (scale ipe300 0.5). I was expecting both values to be shown.

Full document: github / clerk garden. Document screenshot:

image

Simpler reproduction:

(clerk/row {:item 1} {:item 2})

Expected: both items are shown.
Actual: only last item is shown.

image

Fix: wrap both in a vector. Perhaps I should have been doing this all along?

image

Images produced with io.github.nextjournal/clerk {:mvn/version "0.15.957"}.

@teodorlu thanks for the report & repro!

We also support passing a viewer opts map as the first argument and the heuristic to decide is overly simplistic (it interprets and map arg which isn't a wrapped-value as a viewer-opts arg). Besides the workaround to wrap it in a seq, another possibility is to wrap the first arg in :nextjournal/value key:

(clerk/row {:nextjournal/value (scale ipe300 0.5)}
           (scale hea300 0.5))

Right, makes sense. Thanks for explaining :nextjournal/value, TIL!

@teodorlu the attached patch should fix the issue, thank you again!