Tab is a little program that turns Clojure data structures into tables.
Tab's primary aim is to help Clojure programmers make sense of data.
Most interesting Clojure values are maps or seqs of maps. When small, pretty-printing is an adequate tool for inspecting such values. When they get to medium size (like, say, your typical Ring request map), you're better off reaching for something else.
Tab aims to be that something else.
clojure.datafy/datafy) values you give it.Given that you have the Clojure CLI installed, on the command line, run:
clj -Sdeps '{:deps {io.github.eerohele/tab {:git/tag "2024-09-27.371", :git/sha "c5d51f4"}}}'
Then, in the REPL:
user=> (require 'tab.auto)
Tab is listening on http://localhost:57426
nil
user=> (tap> BigInteger)
true
Then, bask in the glory of the table that appears in your browser. If a tabulated BigInteger doesn't do it for you, there are more examples available.
Note In general, you'll probably want to use
tab.apiinstead oftab.auto. The only purpose of thetab.autonamespace is to make it as easy as possible to run a Tab.
See the user manual for instructions of use.
To stop Tab:
user=> (tab.auto/halt)
The tab.auto namespace is the easiest way to run Tab. The tab.api namespace exposes the API proper.
Most importantly, there's tab.api/run and tab.api/halt:
user=> (require '[tab.api :as tab])
nil
;; - Run a Tab in port 1234
;; - Don't open a browser by default.
;; - Set print length to 8
;; - Set print level to 2
user=> (def tab (tab/run :port 1234 :browse? false :print-length 8 :print-level 2))
#'user/tab
user=> (tab/halt tab)
nil
See also:
user=> (require '[tab.api :as tab])
nil
user=> (doc tab/run)
...
user=> (doc tab/tab>)
...
user=> (doc tab/address)
...
user=> (doc tab/halt)
...
Only tab.api and tab.auto are part of Tab's public API. All other namespaces are internal and subject to change.
- to collapse a node.+ to expand a node.- or + to expand or collapse all nodes underneath a node.ARRAY MAP) to zoom in on that table.ARRAY MAP) to copy the value backing that table to your clipboard.#object[...]) to view datafied versions of them (provided that they implement clojure.core.protocols/Datafiable).$N vals in the footer to empty Tab's in-memory database (and release values for garbage collection).For more examples on what Tab can do, see repl/demo/intro.repl.
backdrop-filter, you should be good.:browse? true reportedly has no effect on Windows Subsystem for Linux 2, at least.283 commits
8 commits
Clojure
89.1%
CSS
5.6%
JavaScript
5.1%
Tab is a little program that turns Clojure data structures into tables.
Tab's primary aim is to help Clojure programmers make sense of data.
Most interesting Clojure values are maps or seqs of maps. When small, pretty-printing is an adequate tool for inspecting such values. When they get to medium size (like, say, your typical Ring request map), you're better off reaching for something else.
Tab aims to be that something else.
clojure.datafy/datafy) values you give it.Given that you have the Clojure CLI installed, on the command line, run:
clj -Sdeps '{:deps {io.github.eerohele/tab {:git/tag "2024-09-27.371", :git/sha "c5d51f4"}}}'
Then, in the REPL:
user=> (require 'tab.auto)
Tab is listening on http://localhost:57426
nil
user=> (tap> BigInteger)
true
Then, bask in the glory of the table that appears in your browser. If a tabulated BigInteger doesn't do it for you, there are more examples available.
Note In general, you'll probably want to use
tab.apiinstead oftab.auto. The only purpose of thetab.autonamespace is to make it as easy as possible to run a Tab.
See the user manual for instructions of use.
To stop Tab:
user=> (tab.auto/halt)
The tab.auto namespace is the easiest way to run Tab. The tab.api namespace exposes the API proper.
Most importantly, there's tab.api/run and tab.api/halt:
user=> (require '[tab.api :as tab])
nil
;; - Run a Tab in port 1234
;; - Don't open a browser by default.
;; - Set print length to 8
;; - Set print level to 2
user=> (def tab (tab/run :port 1234 :browse? false :print-length 8 :print-level 2))
#'user/tab
user=> (tab/halt tab)
nil
See also:
user=> (require '[tab.api :as tab])
nil
user=> (doc tab/run)
...
user=> (doc tab/tab>)
...
user=> (doc tab/address)
...
user=> (doc tab/halt)
...
Only tab.api and tab.auto are part of Tab's public API. All other namespaces are internal and subject to change.
- to collapse a node.+ to expand a node.- or + to expand or collapse all nodes underneath a node.ARRAY MAP) to zoom in on that table.ARRAY MAP) to copy the value backing that table to your clipboard.#object[...]) to view datafied versions of them (provided that they implement clojure.core.protocols/Datafiable).$N vals in the footer to empty Tab's in-memory database (and release values for garbage collection).For more examples on what Tab can do, see repl/demo/intro.repl.
backdrop-filter, you should be good.:browse? true reportedly has no effect on Windows Subsystem for Linux 2, at least.283 commits
8 commits
Clojure
89.1%
CSS
5.6%
JavaScript
5.1%