Compare commits
No commits in common. "fdb3e4f3a2b11b84885887e7f48a543f6dcceb5f" and "0e0c797a7391df98e958c2486db198406db120eb" have entirely different histories.
fdb3e4f3a2
...
0e0c797a73
1 changed files with 6 additions and 12 deletions
|
@ -51,7 +51,7 @@
|
||||||
|
|
||||||
(define (style->sequence style port)
|
(define (style->sequence style port)
|
||||||
(define str (style-string style))
|
(define str (style-string style))
|
||||||
(define (just-str) (display str port))
|
(define (just-str) (format port "~a" str))
|
||||||
|
|
||||||
;; Color sequences aren't strings, so handle them specially
|
;; Color sequences aren't strings, so handle them specially
|
||||||
;; Colors don't get resolved until we have the port because we don't know the color profile until then.
|
;; Colors don't get resolved until we have the port because we don't know the color profile until then.
|
||||||
|
@ -72,18 +72,12 @@
|
||||||
|
|
||||||
(define (cons-seq stylish sequence)
|
(define (cons-seq stylish sequence)
|
||||||
(match stylish
|
(match stylish
|
||||||
((? string? str)
|
((? string? str) (make-style str (list sequence)))
|
||||||
(make-style str (list sequence)))
|
((style) (cons-seq style sequence))
|
||||||
((style)
|
((? list? l) (make-style-node (map (cut cons-seq <> sequence) l)))
|
||||||
(cons-seq style sequence))
|
((? style? style) (set-style-sequences style (cons* sequence (style-sequences style))))
|
||||||
((? list? l)
|
|
||||||
(make-style-node (map (cut cons-seq <> sequence) l)))
|
|
||||||
((? style? style)
|
|
||||||
(set-style-sequences style
|
|
||||||
(cons* sequence (style-sequences style))))
|
|
||||||
((? style-node? node)
|
((? style-node? node)
|
||||||
(set-style-node-children node
|
(set-style-node-children node (map (cut cons-seq <> sequence) (style-node-children node))))))
|
||||||
(map (cut cons-seq <> sequence) (style-node-children node))))))
|
|
||||||
|
|
||||||
(define (bold . s) (cons-seq s %BOLD))
|
(define (bold . s) (cons-seq s %BOLD))
|
||||||
(define (faint . s) (cons-seq s %FAINT))
|
(define (faint . s) (cons-seq s %FAINT))
|
||||||
|
|
Loading…
Reference in a new issue