This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-15
Channels
- # announcements (2)
- # beginners (13)
- # calva (17)
- # cider (21)
- # clerk (3)
- # clojure (42)
- # clojure-austin (1)
- # clojure-doc (8)
- # clojure-europe (82)
- # datahike (1)
- # deps-new (13)
- # emacs (5)
- # fulcro (3)
- # hyperfiddle (7)
- # missionary (1)
- # off-topic (16)
- # portal (6)
- # releases (1)
- # shadow-cljs (3)
- # tools-build (1)
- # vim (7)
- # xtdb (3)
I published here some Emacs functions which make the usage of the clerk tap-inspector
more comfortable.
https://github.com/behrica/clerk-mode
My goal was to have an interactive Clerk viewer selection inside of Emacs, so I can render values from namespaces without any reference to Clerk, not even metadata., like:
(ns vega)
{:$schema ""
:data {:values [{:build 1 :result "PASSED"}
{:build 2 :result "PASSED"}
{:build 3 :result "FAILED"}
{:build 4 :result "FAILED"}
{:build 5 :result "SKIPPED"}
{:build 6 :result "PASSED"}
{:build 7 :result "PASSED"}
{:build 8 :result "FAILED"}
{:build 9 :result "PASSED"}
{:build 10 :result "PASSED"}
{:build 11 :result "SKIPPED"}
{:build 12 :result "PASSED"}
{:build 13 :result "PASSED"}
{:build 14 :result "FAILED"}
{:build 15 :result "PASSED"}
{:build 16 :result "SKIPPED"}]}
:description "Bump chart"
:encoding {:order {:field "build" :type "quantitative"}
:x {:field "build" :type "quantitative"}
:y {:field "result" :type "nominal"}}
:mark {:point true :type "line"}}
(map
bean
(System/getProperties))
The function clerk/tap-last-sexp-with-viewer
asks the user interactively (via completion !) which of the current Clerk viewers should be used to tap+render the sexp at point.
This allows then for example to choose the vega-lite viewer.
This overall allows to use Clerk tap-viewer with any Clojure code base.
So far we still need to add "clerk" to the deps.edn
. (at least in a :dev alias or on command-line)
But as soon as Clojure 1.12 add it's add-lib
support is there, we can even add Clerk dynamically while working on a non-clerk aware code base while still having
rich value rendering via Clerk one key stroke away.if you don’t always need a custom viewer one thing to think about is supporting the universal argument to opt into viewer selection
Maybe it would be nice if the tap-inspector
could gain a interactive viewer selection per result cell ?
So we could have "automatic tapping and rendering " of "raw values" (without the Clerk specific metadata for viewer selection), and a user can "switch" the viewer interactively in the Browser.