adding italic and strikethrough ansi escapes

This commit is contained in:
Alex Shinn 2020-07-23 17:50:26 +09:00
parent 9fd9b88660
commit 5a54ecce1d
2 changed files with 40 additions and 2 deletions

View file

@ -389,8 +389,42 @@
;;> ;;>
;;> If ANSI escapes are not enabled, return \var{str}. ;;> If ANSI escapes are not enabled, return \var{str}.
(define underline (make-wrap-procedure (underline-escape) (define underline
(reset-underline-escape))) (make-wrap-procedure (underline-escape) (reset-underline-escape)))
;;> Return a string consisting of an ANSI escape code to select
;;> italic style.
(define italic-escape
(make-simple-escape-procedure 3))
;;> Return a string consisting of an ANSI escape code to select
;;> non-italic style.
(define reset-italic-escape
(make-simple-escape-procedure 23))
;;> Returns \var{str} optionally wrapped in italic escapes.
(define italic
(make-wrap-procedure (italic-escape) (reset-italic-escape)))
;;> Return a string consisting of an ANSI escape code to select
;;> strikethrough style.
(define strikethrough-escape
(make-simple-escape-procedure 9))
;;> Return a string consisting of an ANSI escape code to select
;;> non-strikethrough style.
(define reset-strikethrough-escape
(make-simple-escape-procedure 29))
;;> Returns \var{str} optionally wrapped in strikethrough escapes.
(define strikethrough
(make-wrap-procedure (strikethrough-escape) (reset-strikethrough-escape)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View file

@ -24,12 +24,16 @@
bold bold
underline underline
negative negative
italic
strikethrough
rgb rgb-background rgb rgb-background
gray gray-background gray gray-background
rgb24 rgb24-background rgb24 rgb24-background
bold-escape reset-bold-escape bold-escape reset-bold-escape
underline-escape reset-underline-escape underline-escape reset-underline-escape
negative-escape reset-negative-escape negative-escape reset-negative-escape
italic-escape reset-italic-escape
strikethrough-escape reset-strikethrough-escape
ansi-escapes-enabled?) ansi-escapes-enabled?)
(import (scheme base) (import (scheme base)