Skip to content

Commit

Permalink
started work on ascii table
Browse files Browse the repository at this point in the history
  • Loading branch information
juerg committed Dec 9, 2023
1 parent 77d0431 commit a68fb79
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public static boolean isValidModule(final VncKeyword module) {
Arrays.asList(
"ansi",
"app",
"ascii-table",
"benchmark",
"cargo",
"cargo-arangodb",
Expand Down
33 changes: 33 additions & 0 deletions src/main/resources/com/github/jlangch/venice/ascii-table.venice
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,37 @@

(ns ascii-table)

;; standard double bold alpha
;;
;; +---+---+---+ ╔═══╤═══╤═══╗ ┏━━━┯━━━┯━━━┓ ABBBCBBBCBBBD
;; head | | | | ║ │ │ ║ ┃ │ │ ┃ E M M E
;; +---+---+---+ ╠═══╪═══╪═══╣ ┣━━━┿━━━┿━━━┫ KGGGJGGGJGGGL
;; body | | | | ║ │ │ ║ ┃ │ │ ┃ E M M E
;; +---+---+---+ ╟───┼───┼───╢ ┠───┼───┼───┫ KGGGJGGGJGGGL
;; body | | | | ║ │ │ ║ ┃ │ │ ┃ E M M E
;; +---+---+---+ ╠═══╪═══╪═══╣ ┣━━━┿━━━┿━━━┫ KGGGJGGGJGGGL
;; foot | | | | ║ │ │ ║ ┃ │ │ ┃ E M M E
;; +---+---+---+ ╚═══╧═══╧═══╝ ┗━━━┷━━━┷━━━┛ NBBBOBBBOBBBP

;; https://www.charset.org/utf-8/10


(def border-chars { :standard "+-++|+-+++++|++++"
:double "╔═╤╗║╟─┬╢╪╠╣│╚╧╝┼"
:bold "┏━┯┓┃┠─┬┨┿┣┫│┗┷┛┼"
:alpha "ABCDEFGHIJKLMNOPQ" } )

(def alignments #{:left :center :right})
(def overflow #{:newline :clip-left :clip-right :ellipsis-left :ellipsis-right})
(def modes #{:standard :double :bold :alpha})

(def min-col-width 1)
(def min-col-width 80)




(defn render [cols header body & options]
(let [opts (apply hash-map options)]
))

0 comments on commit a68fb79

Please sign in to comment.