Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
teodorlu opened this issue Oct 26, 2023 · 4 comments
Closed

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

teodorlu opened this issue Oct 26, 2023 · 4 comments

Comments

@teodorlu
Copy link
Contributor

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

@teodorlu
Copy link
Contributor Author

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"}.

@mk
Copy link
Member

mk commented Oct 29, 2023

@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))

@teodorlu
Copy link
Contributor Author

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

@mk
Copy link
Member

mk commented Nov 5, 2023

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

@mk mk closed this as completed in b95bcd7 Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants