This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-12-04
Channels
- # adventofcode (161)
- # asami (2)
- # babashka (56)
- # beginners (128)
- # calva (57)
- # cider (10)
- # circleci (1)
- # clj-kondo (4)
- # clojure (13)
- # clojure-europe (44)
- # clojure-france (32)
- # clojure-italy (3)
- # clojure-nl (18)
- # clojure-spec (7)
- # clojure-uk (26)
- # clojurescript (18)
- # code-reviews (15)
- # community-development (7)
- # conjure (5)
- # cryogen (8)
- # cursive (31)
- # datomic (18)
- # emacs (8)
- # events (4)
- # figwheel-main (7)
- # fulcro (42)
- # juxt (3)
- # kaocha (58)
- # lambdaisland (1)
- # malli (1)
- # minimallist (1)
- # pathom (11)
- # pedestal (9)
- # re-frame (28)
- # reagent (20)
- # reclojure (4)
- # releases (1)
- # reveal (23)
- # schema (2)
- # shadow-cljs (7)
- # test-check (67)
- # xtdb (23)
@vlaaad Is there a way to get Reveal to display a string value laid out with newlines and tabs etc?
There is example action in the readme:
(rx/defaction ::unescape [x]
(when (string? x)
#(rx/stream-as-is
(rx/as x (rx/raw-string x {:fill :string})))))
@vlaaad Thanks. How would that look in place of something like this:
{:fx/type rx-table-view
:items [x']
:v-box/vgrow :always
:columns [{:fn identity :header 'value}]}
i.e., if x'
is a string and I wanted to display it as a raw string?
That didn't work.
Oh, wait, I think I have a typo...
Hmm... "class clojure.lang.AFunction$1 cannot be cast to class clojure.lang.IPersistentMap (clojure.lang.AFunction$1 and clojure.lang.IPersistentMap are in unnamed module of loader 'app')"
Here's the full context:
(rx-stream-as-is
(rx-as
{:fx/type rx-obs-view
:ref last-tap
:fn (fn [x]
(let [x' (if (var? x) (deref x) x)]
{:fx/type :v-box
:children
[{:fx/type rx-value-view
:v-box/vgrow :always
:value (assoc (meta x)
:_meta (meta x')
:_class (class x'))}
(cond
(string? x')
(rx-stream-as-is (rx-as x' (rx-raw-string x' {:fill :string})))
(or (nil? x') (not (seqable? x')))
{:fx/type rx-table-view
:items [x']
:v-box/vgrow :always
:columns [{:fn identity :header 'value}]}
:else ...
I have these dynamically resolved so rx-
means rx/
The above gives me "class vlaaad.reveal.stream$_EQ__GT_$fn__3596 cannot be cast to class clojure.lang.IPersistentMap (vlaaad.reveal.stream$_EQ__GT_$fn__3596 is in unnamed module of loader clojure.lang.DynamicClassLoader @19d27c27; clojure.lang.IPersistentMap is in unnamed module of loader 'app')"
If I remove the stream-as-is wrapper in that string? cond clause, I get the AFunction$1 cast exception above.
Argh! Somehow that was about the only combination I hadn't tried! Perfect! Checkout https://github.com/seancorfield/dot-clojure/blob/develop/dev.clj#L25-L27
Awesome, I love it! For every evaluation you automatically see value's meta and, if appropriate, documentation!
I just added code to automatically render
's inline as web views -- like REBL does -- so that I can use ctrl-; j
and ctrl-; ?
(from my Atom/Chlorine or VS Code/Clover setup) and have Javadocs or Clojuredocs displayed automatically for types or symbols, respectively.
seeing it here https://github.com/seancorfield/dot-clojure/blob/develop/dev.clj#L66-L68 🙂
how do I clear the buffer in the reveal window?