Work on table rendering and integrate it.
This commit is contained in:
parent
6d9c5b8d31
commit
6eeea2f1f3
2 changed files with 33 additions and 9 deletions
20
table.scm
20
table.scm
|
@ -35,6 +35,7 @@
|
|||
(chicken base)
|
||||
(chicken string)
|
||||
(chicken format)
|
||||
(chicken keyword)
|
||||
ansi
|
||||
testing)
|
||||
|
||||
|
@ -153,8 +154,25 @@
|
|||
(table-stringify
|
||||
(table-rectangularize tbl))))))
|
||||
|
||||
;; Table border styles in visual form
|
||||
(define table-borders-lookup-source
|
||||
'((ascii "/~,\\"
|
||||
"| ||"
|
||||
">-+<"
|
||||
"'~^`")))
|
||||
|
||||
;; Compiled table borders for rendering
|
||||
(define table-borders-lookup
|
||||
(map (lambda (src)
|
||||
(cons (car src) (apply string-join (cdr src))))
|
||||
table-borders-lookup-source))
|
||||
|
||||
(define (table->string tbl . args)
|
||||
"")
|
||||
(let ((table-border (get-keyword #:table-border args (lambda () #f)))
|
||||
(cell-border (get-keyword #:cell-border args (lambda () #f)))
|
||||
(border-style (get-keyword #:border-style args (lambda () 'ascii)))
|
||||
(table (table-prepare tbl)))
|
||||
""))
|
||||
|
||||
;; Performs module self-tests
|
||||
(define (table-tests!)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue