Fork me on GitHub
#portal
<
2022-05-11
>
robert-stuttaford06:05:34

i'd like things to appear via the tree viewer by default. i'm trying to do the metadata on tap> thing but it doesn't appear to work. is this what i should be doing? i'm on 0.25.0

(tap> ^{:portal.viewer/default :portal.viewer/tree} txes)

1
robert-stuttaford06:05:34

ok so you're doing with-meta, i'll try that, thanks!

seancorfield06:05:08

I think if you tap the same value twice, it treats it as equal and ignores metadata. Vaguely recall a bug in that area.

robert-stuttaford06:05:59

after switching to your code and restarting the ui, it's working. thank you!

seancorfield06:05:01

I've switched to just using plain tap> but adding hotkeys to navigate into Portal and expand the 1st-level, 2nd-level, or 3rd-level item

robert-stuttaford06:05:56

man, you are really ace at setting up your dev env, @U04V70XH6

seancorfield06:05:36

I need to make some short videos showing my workflow... but I hate video as a format 🙂

seancorfield06:05:58

I like to completely change my dev setup about once a year as well. I just switched from Clover to using Calva's nREPL stuff, so it's a complete change of keybindings and a different customization approach.

seancorfield06:05:49

(I'd already been using Calva for a lot of static stuff but with Joyride and those custom REPL snippets, it's easy to really tailor Calva to my preferred workflow)

robert-stuttaford06:05:44

you have a much bigger appetite for this than i do, haha

robert-stuttaford06:05:55

i'm still using the same emacs config from 5 years ago

seancorfield07:05:02

I went through maybe half a dozen different emacs configs in the time I was doing Clojure with emacs... but my exposure to emacs dates back to the 17.x series which was... 1986... but I've switched back and forth across so many editors over the last decade: TextMate was how I first started doing Clojure! But Eclipse/CCW, LightTable, NightCode, Emacs, Atom, VS Code... I've tried IntelliJ multiple times over the years (probably decades at this point) and never liked it.

robert-stuttaford07:05:04

TextMate ❤️

1
wilkerlucio14:05:10

textmate brings Rails times memories to me XD

djblue16:05:12

You can also do something like:

(require '[portal.api :as p])

(def defaults
  {string? :portal.viewer/text
   bytes?  :portal.viewer/bin})

(defn- get-viewer [value]
  (or (some (fn [[predicate viewer]]
              (when (predicate value)
                viewer))
            defaults)
      :portal.viewer/tree))

(defn submit [value]
  (p/submit
   (with-meta
     [(get-viewer value) value]
     {:portal.viewer/default :portal.viewer/hiccup})))

(add-tap #'submit)
in your runtime to set the default viewer 👌

💯 2