Fork me on GitHub
#babashka
<
2023-04-14
>
mmer11:04:58

Hi, I specter still not in the bb packages?

borkdude11:04:45

Hey @U4C3ZU6KX - you can add specter to bb.edn and then use it

mmer12:04:30

Thanks - when it says a local bb.edn - where should that file exist?

borkdude12:04:58

In the root of your project, similar to deps.edn

borkdude12:04:38

or do I understand your question wrong?

mmer12:04:12

It is working - I had put the file where the bb bin file was.

πŸ‘ 2
joakimen13:04:09

Any chance we’ll see a babashka.pprint at some point, or is that in the β€œtoo frivolous to justify the added size”-box? In particular, I feel like the print-table added to bbin (https://github.com/babashka/bbin/blob/main/bbin#L137) is more practical than the clojure.pprint/print-table due to left-alignment of text and less noise (the clojure.pprint one doesn’t qualify as a markdown-table, so it’s kind of just visual clutter anyway). Examples for comparison

;; clojure.pprint
|                                             :name | :age |
|---------------------------------------------------+------|
|                          Long John Johnson McJohn |   41 |
|                                              Bert |   54 |
| Hubert Blaine Wolfeschlegelsteinhausenbergerdorff |   39 |

;; bbin pprint
name                                               age
─────────────────────────────────────────────────  ───
Long John Johnson McJohn                           41
Bert                                               54
Hubert Blaine Wolfeschlegelsteinhausenbergerdorff  39

borkdude13:04:16

@U0422G22932 There's various libraries that can do this that are already compatible with babashka I think

joakimen13:04:46

Crockery worked perfectly with bb!

{:deps {com.joshuadavey/crockery {:mvn/version "0.2.0"}}}
(require '[crockery.core :as crockery])

(crockery/print-table {:format :fancy} ;; style
                      [{:name :name :align :left} {:name :age :align :right}] ;; alignment
                      [{:name "Long John Johnson McJohn" :age 41} ;; data
                       {:name "Bert" :age 54}
                       {:name "Hubert Blaine Wolfeschlegelsteinhausenbergerdorff" :age 39}])
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”
β”‚ Name                                              β”‚ Age β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€
β”‚ Long John Johnson McJohn                          β”‚  41 β”‚
β”‚ Bert                                              β”‚  54 β”‚
β”‚ Hubert Blaine Wolfeschlegelsteinhausenbergerdorff β”‚  39 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”˜

joakimen13:04:11

Will check out doric too πŸ™‚ Thanks!

nate15:04:20

using https://github.com/justone/tabl as a pod also makes various table printing capabilities possible

πŸŽ‰ 2
πŸ‘€ 2
nate15:04:32

(disclosure, I wrote tabl)

mmer16:04:31

I am having some issues with the yaml library built into bb. Does it support more of the dumper options than the docs show. For example it is converting double quotes to single and that does not work for me. I tried to load the [io.forward/yaml {:mvn/version "1.0.11"}] and it fails when you do a require. This library has more dumper options. Any ideas which way to go.

borkdude16:04:13

the clj-yaml library is the only library that works with bb. if you need more options please go to #C042XAQFCCU and we'll update the lib after changes have been made