(format-tree tree)(format-tree tree prefix check)returns a string representation of a tree
(-> (format-tree '[{a "1.1"} [{b "1.2"} [{c "1.3"} {d "1.4"}]]]) (string/split-lines)) => ["{a "1.1"}" " {b "1.2"}" " {c "1.3"}" " {d "1.4"}" ""]
returns a string representation of a tree
(-> (format-tree '[{a "1.1"}
[{b "1.2"}
[{c "1.3"}
{d "1.4"}]]])
(string/split-lines))
=> ["{a \"1.1\"}"
" {b \"1.2\"}"
" {c \"1.3\"}"
" {d \"1.4\"}" ""](justify align content length)justifies the content to a given alignment
(justify :right "hello" 10) => "hello"
(justify :left "hello" 10) => "hello "
justifies the content to a given alignment (justify :right "hello" 10) => "hello" (justify :left "hello" 10) => "hello "
(pad len)creates n number of spaces
(pad 1) => "" (pad 5) => ""
creates `n` number of spaces (pad 1) => "" (pad 5) => ""
(pad-center content length)puts the content at the center, padding missing spacing
(pad-center "hello" 10) => "hello "
puts the content at the center, padding missing spacing (pad-center "hello" 10) => "hello "
(pad-down row length height)creates new lines of n spaces (pad-down [] 10 2) => [" " " "]
creates new lines of n spaces (pad-down [] 10 2) => [" " " "]
(pad-left content length)puts the content to the right, padding missing spaces
(pad-left "hello" 10) => "hello"
puts the content to the right, padding missing spaces (pad-left "hello" 10) => "hello"
(pad-right content length)puts the content to the left, padding missing spaces
(pad-right "hello" 10) => "hello "
puts the content to the left, padding missing spaces (pad-right "hello" 10) => "hello "
(prepare-elements row {:keys [padding columns] :as params})same as row-elements but allows for colors and results
(prepare-elements ["hello" :world [:a :b :c :d]] {:padding 0 :spacing 1 :columns [{:align :right :length 10} {:align :center :length 10} {:align :left :length 10}]})
=> [[" hello" " "] [" :world " " "] ["[:a :b :c " " :d] "]]
same as row-elements but allows for colors and results
(prepare-elements ["hello" :world [:a :b :c :d]]
{:padding 0
:spacing 1
:columns [{:align :right :length 10}
{:align :center :length 10}
{:align :left :length 10}]})
=> [[" hello" " "]
[" :world " " "]
["[:a :b :c " " :d] "]](print-column items name color)prints the column
(-> (print-column [[:id.a {:data 100}] [:id.b {:data 200}]] :data #{}) (with-out-str))
prints the column
(-> (print-column [[:id.a {:data 100}] [:id.b {:data 200}]]
:data
#{})
(with-out-str))(print-compare output)outputs a side by side comparison
(-> (print-compare [['hara.code [[:a :b :c] [:d :e :f]]]]) (with-out-str))
outputs a side by side comparison
(-> (print-compare [['hara.code [[:a :b :c] [:d :e :f]]]])
(with-out-str))(print-header titles {:keys [padding columns] :as params})prints a header for the row
(-> (print-header [:id :name :value] {:padding 0 :spacing 1 :columns [{:align :right :length 10} {:align :center :length 10} {:align :left :length 10}]}) (with-out-str))
prints a header for the row
(-> (print-header [:id :name :value]
{:padding 0
:spacing 1
:columns [{:align :right :length 10}
{:align :center :length 10}
{:align :left :length 10}]})
(with-out-str))(print-row row params)prints a row to output
(-> (print-row ["hello" :world (result/result {:data [:a :b :c :d :e :f] :status :info})] {:padding 0 :spacing 1 :columns [{:align :right :length 10} {:align :center :length 10} {:align :left :length 10}]}) (with-out-str))
prints a row to output
(-> (print-row ["hello" :world (result/result {:data [:a :b :c :d :e :f]
:status :info})]
{:padding 0
:spacing 1
:columns [{:align :right :length 10}
{:align :center :length 10}
{:align :left :length 10}]})
(with-out-str))(print-subtitle text)prints the subtitle
(-> (print-subtitle "Hello Again") (with-out-str))
prints the subtitle
(-> (print-subtitle "Hello Again")
(with-out-str))(print-summary m)outputs the summary of results
(-> (print-summary {:count 6 :files 2}) (with-out-str))
outputs the summary of results
(-> (print-summary {:count 6 :files 2})
(with-out-str))(print-title title)prints the title
(-> (print-title "Hello World") (with-out-str))
prints the title
(-> (print-title "Hello World")
(with-out-str))(print-tree tree)(print-tree tree prefix check)outputs the result of format-tree
(print-tree '[{a "1.1"} [{b "1.2"} [{c "1.3"} {d "1.4"}]]])
outputs the result of `format-tree`
(print-tree '[{a "1.1"}
[{b "1.2"}
[{c "1.3"}
{d "1.4"}]]])(row-elements row {:keys [padding spacing columns] :as params})layout raw elements based on alignment and length properties
(row-elements ["hello" :world [:a :b :c :d :e :f]] {:padding 0 :spacing 1 :columns [{:align :right :length 10} {:align :center :length 10} {:align :left :length 10}]}) => [[" hello"] [" :world "] ["[:a :b :c " " :d :e :f]"]]
layout raw elements based on alignment and length properties
(row-elements ["hello" :world [:a :b :c :d :e :f]]
{:padding 0
:spacing 1
:columns [{:align :right :length 10}
{:align :center :length 10}
{:align :left :length 10}]})
=> [[" hello"] [" :world "] ["[:a :b :c "
" :d :e :f]"]](seq-elements arr {:keys [align length]} padding spacing)layout an array of elements as a series of rows of a given length
(seq-elements ["A" "BC" "DEF" "GHIJ" "KLMNO"] {:align :left :length 9} 0 1) => {:rows ["[A BC DEF" " GHIJ " " KLMNO] "]}
layout an array of elements as a series of rows of a given length
(seq-elements ["A" "BC" "DEF" "GHIJ" "KLMNO"]
{:align :left
:length 9}
0
1)
=> {:rows ["[A BC DEF"
" GHIJ "
" KLMNO] "]}cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |