Add tables and spinners
This commit is contained in:
parent
51f5e862a3
commit
ac81aeaddc
5 changed files with 77 additions and 3 deletions
19
spinner.scm
Normal file
19
spinner.scm
Normal file
|
@ -0,0 +1,19 @@
|
|||
(define +spinner-styles+
|
||||
'((dots . "⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏")
|
||||
(block . "▖▘▝▗")
|
||||
(triangle . "◢◣◤◥")
|
||||
(circle . "◐◓◑◒")
|
||||
(vertical . "▁▃▄▅▆▇█▇▆▅▄▃")
|
||||
(horizontal . "▉▊▋▌▍▎▏▎▍▌▋▊▉")
|
||||
(ascii . "|/-\\")))
|
||||
|
||||
(define (spinner i text-before text-after #!key (style 'dots))
|
||||
(define spinner-chars (cdr (assoc style +spinner-styles+)))
|
||||
(string-append
|
||||
(cursor-up 1)
|
||||
(parse-markup text-before)
|
||||
" "
|
||||
(string (string-ref spinner-chars (modulo i (string-length spinner-chars))))
|
||||
" "
|
||||
(parse-markup text-after)
|
||||
"\n"))
|
Loading…
Add table
Add a link
Reference in a new issue