This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-04-14
Channels
- # ai (24)
- # announcements (36)
- # babashka (15)
- # babashka-sci-dev (8)
- # beginners (18)
- # biff (4)
- # calva (24)
- # cider (13)
- # clj-kondo (1)
- # clj-on-windows (2)
- # clojars (15)
- # clojure (120)
- # clojure-dev (13)
- # clojure-europe (69)
- # clojure-nl (1)
- # clojure-norway (8)
- # clojure-uk (2)
- # clojurescript (4)
- # core-logic (2)
- # cursive (6)
- # datomic (193)
- # dev-tooling (4)
- # emacs (1)
- # hyperfiddle (57)
- # lsp (56)
- # malli (11)
- # missionary (15)
- # nbb (61)
- # off-topic (8)
- # polylith (8)
- # practicalli (2)
- # proletarian (1)
- # reitit (3)
- # releases (2)
- # remote-jobs (1)
- # shadow-cljs (13)
- # spacemacs (1)
- # specter (2)
- # sql (17)
- # tools-deps (3)
- # vim (38)
Hey @U4C3ZU6KX - you can add specter to bb.edn
and then use it
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
@U0422G22932 There's various libraries that can do this that are already compatible with babashka I think
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 β
βββββββββββββββββββββββββββββββββββββββββββββββββββββ΄ββββββ
using https://github.com/justone/tabl as a pod also makes various table printing capabilities possible
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.