Fork me on GitHub
#clerk
<
2023-01-23
>
jeroenvandijk10:01:52

Is there a way to hide the metadata, but showing the clojure form? E.g. the following where you would only see (def a 1) and not the metadata form.

^{:nextjournal.clerk/visibility {:result :hide}}
(def a 1)

jeroenvandijk10:01:44

I guess I could wrap the form with the map settings

{:nextjournal.clerk/visibility {:result :hide :code :show}}

(def a 1)

{:nextjournal.clerk/visibility {:result :hide :code hide}}
But this feels a little fragile

elken10:01:13

That's how I've been doing it, I'd love a better solution though

jeroenvandijk11:01:03

Ah probably an older one 😅 I’ll check

jeroenvandijk11:01:18

“0.12.707”

jeroenvandijk11:01:35

I’ll check it with that version

jeroenvandijk11:01:19

With

io.github.nextjournal/clerk {:git/sha "0bae6fdb2bce6d86e70ab62270ebbecfc105a652"}
It works! Thanks! @U5H74UNSF

🙌 2
mkvlr11:01:35

@U0FT7SRLP cool, glad to hear

Brett Rowberry15:01:13

Does anyone have a writeup on using Clerk with Calva?

Carsten Behring16:01:03

Just to comment here, that I see "two ways" of using Clerk from Calva. 1. "Clerk as notebook viewer" 2. "Clerk as single value viewer using Clerk tap inspector" These are different workflows and maybe require different "snippets" or "keys" for easier integration

Brett Rowberry16:01:56

Wow, I didn’t even know about 2.

plus_one 2
Carsten Behring16:01:08

In principle it supports all Clerk viewers (a bit tricky to configure) and use. Using it as a "tap>" target has no obvious way of choosing the viewer to use. But wrapping a value in Clerk specific metadata which sets the viewer would work.

Carsten Behring16:01:01

If you are interested, I have some EmacsLisp code which does this for Emacs.

Matt19:01:15

You can also pop open a simple browser in VS Code (`simpleBrowser.show`) and point it to your https://localhost:7777 It's not perfect but its noice enough. Additionally, you can https://cljdoc.org/d/djblue/portal/0.35.1/doc/guides/clerk and get the best of both worlds in said browser window. I personally am running the Portal VS Code extension which plays decently. I think Joyride might be able to glue a lot of this stuff together.

Carsten Behring09:01:56

@U04GFG14FCP Your link described "viewer selection" for Portal, while mine does "viewer selection" for Clerk. And mine adds to it "interactive viewer selection" done by Emacs. (running Clojure code which wraps the value) In your example you suppose to send values e to "tap>" by "writing code in repl". My examples does it "on keypress" in Emacs. (integrated in the Emacs cider-inspector)

Stephan Renatus09:01:17

@U7CAHM72M sorry, I’m new to this. thanks for helping me out — I’m aware of the difference, I was just wondering if the mechanism, adding metadata like this, was the same. 😅