bkyk8rc3zvpnsf5inmcqq4n3k98cv6hj-my-site-hyper-literate-git.test.suzanne.soy-0.0.1

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

box-chars.scrbl (977B)


      1 #lang scribble/base
      2 
      3 @;{ This test is mainly intended for checking Latex
      4     rendering of box characters, but it should render
      5     ok with text, too. }
      6 
      7 @(define charss
      8          '((#\┌ #\─ #\┐ #\│ #\└ #\┘ #\┬ #\├ #\┤ #\┼ #\┴)
      9            (#\╔ #\═ #\╗ #\║ #\╚ #\╝ #\╦ #\╠ #\╣ #\╬ #\╩)
     10            (#\┏ #\━ #\┓ #\┃ #\┗ #\┛ #\┳ #\┣ #\┫ #\╋ #\┻)))
     11 
     12 @(define (adj-verbatim which . strs)
     13   (define ht (for/hash ([c1 (in-list (car charss))]
     14                         [c2 (in-list (list-ref charss which))])
     15                (values c1 c2)))
     16   (apply verbatim
     17          (for/list ([s (in-list strs)])
     18            (list->string
     19             (for/list ([c (in-string s)])
     20               (hash-ref ht c c))))))
     21 
     22 @verbatim{
     23 ┌┬─┐
     24 ├┤ │
     25 └┼─┼┐
     26  └─┴┘
     27  }
     28 
     29 @adj-verbatim[1]{
     30 ┌┬─┐
     31 ├┤ │
     32 └┼─┼┐
     33  └─┴┘
     34  }
     35 
     36 @adj-verbatim[2]{
     37 ┌┬─┐
     38 ├┤ │
     39 └┼─┼┐
     40  └─┴┘
     41  }