Don't use version-case, it is not compatible with Racket 6.1
This commit is contained in:
parent
746d58b426
commit
7a4b5139bb
22
dollar.rkt
22
dollar.rkt
|
@ -10,7 +10,6 @@
|
||||||
"katex-convert-unicode.rkt"
|
"katex-convert-unicode.rkt"
|
||||||
"mathjax-convert-unicode.rkt"
|
"mathjax-convert-unicode.rkt"
|
||||||
racket/list
|
racket/list
|
||||||
version-case
|
|
||||||
(only-in xml cdata)
|
(only-in xml cdata)
|
||||||
(only-in racket/match match)
|
(only-in racket/match match)
|
||||||
(only-in racket/system process)
|
(only-in racket/system process)
|
||||||
|
@ -32,6 +31,12 @@
|
||||||
current-tex2svg-path
|
current-tex2svg-path
|
||||||
with-html5)
|
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,
|
;; 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.
|
;; so we define a style modifier which replaces the prefix for HTML rendering.
|
||||||
(define (with-html5 doc-style)
|
(define (with-html5 doc-style)
|
||||||
|
@ -302,8 +307,7 @@ EOTEX
|
||||||
(elem #:style math-inline-style-katex
|
(elem #:style math-inline-style-katex
|
||||||
(map (λ (s) (katex-convert-unicode s #t)) (flatten strs))))
|
(map (λ (s) (katex-convert-unicode s #t)) (flatten strs))))
|
||||||
|
|
||||||
(version-case
|
(if-version≥6.12
|
||||||
[(version>= (version) "6.11.0.900"]
|
|
||||||
(define current-tex2svg-path (make-parameter #f))
|
(define current-tex2svg-path (make-parameter #f))
|
||||||
|
|
||||||
(define (find-tex2svg)
|
(define (find-tex2svg)
|
||||||
|
@ -337,7 +341,7 @@ EOTEX
|
||||||
(list
|
(list
|
||||||
(xexpr-property
|
(xexpr-property
|
||||||
(cdata #f #f (tex2svg #:inline #t (flatten strs)))
|
(cdata #f #f (tex2svg #:inline #t (flatten strs)))
|
||||||
(cdata #f #f ""))))))])
|
(cdata #f #f "")))))))
|
||||||
|
|
||||||
(define ($$-mathjax strs)
|
(define ($$-mathjax strs)
|
||||||
(elem #:style math-display-style-mathjax strs))
|
(elem #:style math-display-style-mathjax strs))
|
||||||
|
@ -346,14 +350,13 @@ EOTEX
|
||||||
(elem #:style math-display-style-katex
|
(elem #:style math-display-style-katex
|
||||||
(map (λ (s) (katex-convert-unicode s #t)) (flatten strs))))
|
(map (λ (s) (katex-convert-unicode s #t)) (flatten strs))))
|
||||||
|
|
||||||
(version-case
|
(if-version≥6.12
|
||||||
[(version>= (version) "6.11.0.900"]
|
|
||||||
(define ($$-tex2svg strs)
|
(define ($$-tex2svg strs)
|
||||||
(elem #:style (style #f
|
(elem #:style (style #f
|
||||||
(list
|
(list
|
||||||
(xexpr-property
|
(xexpr-property
|
||||||
(cdata #f #f (tex2svg (flatten strs)))
|
(cdata #f #f (tex2svg (flatten strs)))
|
||||||
(cdata #f #f ""))))))])
|
(cdata #f #f "")))))))
|
||||||
|
|
||||||
(define $-html-handler (make-parameter $-katex))
|
(define $-html-handler (make-parameter $-katex))
|
||||||
(define $$-html-handler (make-parameter $$-katex))
|
(define $$-html-handler (make-parameter $$-katex))
|
||||||
|
@ -368,12 +371,11 @@ EOTEX
|
||||||
($$-html-handler $$-mathjax)
|
($$-html-handler $$-mathjax)
|
||||||
(void))
|
(void))
|
||||||
|
|
||||||
(version-case
|
(if-version≥6.12
|
||||||
[(version>= (version) "6.11.0.900"]
|
|
||||||
(define (use-tex2svg)
|
(define (use-tex2svg)
|
||||||
($-html-handler $-tex2svg)
|
($-html-handler $-tex2svg)
|
||||||
($$-html-handler $$-tex2svg)
|
($$-html-handler $$-tex2svg)
|
||||||
(void))])
|
(void)))
|
||||||
|
|
||||||
(define ($ . strs)
|
(define ($ . strs)
|
||||||
(let ([$- ($-html-handler)])
|
(let ([$- ($-html-handler)])
|
||||||
|
|
3
info.rkt
3
info.rkt
|
@ -2,8 +2,7 @@
|
||||||
(define collection "scribble-math")
|
(define collection "scribble-math")
|
||||||
(define deps '("base"
|
(define deps '("base"
|
||||||
"rackunit-lib"
|
"rackunit-lib"
|
||||||
"scribble-lib"
|
"scribble-lib"))
|
||||||
"version-case"))
|
|
||||||
(define build-deps '("scribble-lib"
|
(define build-deps '("scribble-lib"
|
||||||
"racket-doc"
|
"racket-doc"
|
||||||
"at-exp-lib"
|
"at-exp-lib"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user