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
18
Makefile
18
Makefile
|
@ -42,22 +42,22 @@ BBSTOOL-DEPS=bbstool.scm testing.import.scm listing.import.scm \
|
|||
ansi.import.scm member-file.import.scm \
|
||||
command-line.import.scm members-base.import.scm \
|
||||
utils.import.scm primes.import.scm member-record.import.scm \
|
||||
configuration.import.scm progress.import.scm
|
||||
configuration.import.scm progress.import.scm table.import.scm
|
||||
|
||||
BBSTOOL-SOURCES=bbstool.scm testing.scm listing.scm \
|
||||
dictionary.scm month.scm period.scm ansi.scm member-file.scm \
|
||||
BBSTOOL-SOURCES=bbstool.scm testing.scm listing.scm dictionary.scm \
|
||||
month.scm period.scm ansi.scm member-file.scm \
|
||||
command-line.scm members-base.scm utils.scm primes.scm \
|
||||
member-record.scm configuration.scm progress.scm
|
||||
member-record.scm configuration.scm progress.scm table.scm
|
||||
|
||||
BBSTOOL-OBJS=testing.o listing.o month.o period.o ansi.o \
|
||||
member-file.o dictionary.o command-line.o \
|
||||
members-base.o utils.o primes.o member-record.o \
|
||||
configuration.o progress.o
|
||||
configuration.o progress.o table.o
|
||||
|
||||
BBSTOOL-SHARED=testing.so listing.so month.so period.so ansi.so \
|
||||
member-file.so dictionary.so command-line.so \
|
||||
members-base.so utils.so primes.so member-record.so \
|
||||
configuration.so progress.so
|
||||
configuration.so progress.so table.so
|
||||
|
||||
.PHONY: imports
|
||||
imports: $(BBSTOOL-DEPS)
|
||||
|
@ -181,3 +181,9 @@ PROGRESS-SOURCES=progress.scm
|
|||
progress.so: progress.o
|
||||
progress.o: progress.import.scm
|
||||
progress.import.scm: $(PROGRESS-SOURCES)
|
||||
|
||||
TABLE-SOURCES=table.scm ansi.import.scm testing.import.scm
|
||||
|
||||
table.so: table.o
|
||||
table.o: table.import.scm
|
||||
table.import.scm: $(TABLE-SOURCES)
|
||||
|
|
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