Don't use version-case, it is not compatible with Racket 6.1

This commit is contained in:
Suzanne Dupéron 2020-07-23 22:00:27 +01:00 committed by GitHub
parent 746d58b426
commit 7a4b5139bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 12 deletions

View File

@ -10,7 +10,6 @@
"katex-convert-unicode.rkt"
"mathjax-convert-unicode.rkt"
racket/list
version-case
(only-in xml cdata)
(only-in racket/match match)
(only-in racket/system process)
@ -32,6 +31,12 @@
current-tex2svg-path
with-html5)
(define-syntax (if-version≥6.12 stx)
(syntax-case stx ()
[(_ . rest)
(if (version>= (version) "6.11.0.900")
#'(begin . rest)
#'(begin))]))
;; KaTeX does not work well with the HTML 4.01 Transitional loose DTD,
;; so we define a style modifier which replaces the prefix for HTML rendering.
(define (with-html5 doc-style)
@ -302,8 +307,7 @@ EOTEX
(elem #:style math-inline-style-katex
(map (λ (s) (katex-convert-unicode s #t)) (flatten strs))))
(version-case
[(version>= (version) "6.11.0.900"]
(if-version≥6.12
(define current-tex2svg-path (make-parameter #f))
(define (find-tex2svg)
@ -337,7 +341,7 @@ EOTEX
(list
(xexpr-property
(cdata #f #f (tex2svg #:inline #t (flatten strs)))
(cdata #f #f ""))))))])
(cdata #f #f "")))))))
(define ($$-mathjax strs)
(elem #:style math-display-style-mathjax strs))
@ -346,14 +350,13 @@ EOTEX
(elem #:style math-display-style-katex
(map (λ (s) (katex-convert-unicode s #t)) (flatten strs))))
(version-case
[(version>= (version) "6.11.0.900"]
(if-version≥6.12
(define ($$-tex2svg strs)
(elem #:style (style #f
(list
(xexpr-property
(cdata #f #f (tex2svg (flatten strs)))
(cdata #f #f ""))))))])
(cdata #f #f "")))))))
(define $-html-handler (make-parameter $-katex))
(define $$-html-handler (make-parameter $$-katex))
@ -368,12 +371,11 @@ EOTEX
($$-html-handler $$-mathjax)
(void))
(version-case
[(version>= (version) "6.11.0.900"]
(if-version≥6.12
(define (use-tex2svg)
($-html-handler $-tex2svg)
($$-html-handler $$-tex2svg)
(void))])
(void)))
(define ($ . strs)
(let ([$- ($-html-handler)])

View File

@ -2,8 +2,7 @@
(define collection "scribble-math")
(define deps '("base"
"rackunit-lib"
"scribble-lib"
"version-case"))
"scribble-lib"))
(define build-deps '("scribble-lib"
"racket-doc"
"at-exp-lib"