|
|
|
@ -172,10 +172,20 @@
|
|
|
|
|
;; convert our input Q-expression into a useful form.
|
|
|
|
|
|
|
|
|
|
;; some typographic niceties
|
|
|
|
|
(define qexpr (decode qx-arg
|
|
|
|
|
(define qexpr
|
|
|
|
|
(let ([qx (decode qx-arg
|
|
|
|
|
#:string-proc (compose1 smart-ellipses smart-dashes)
|
|
|
|
|
#:txexpr-proc smart-quotes))
|
|
|
|
|
|
|
|
|
|
#:txexpr-proc smart-quotes)])
|
|
|
|
|
(match qx
|
|
|
|
|
[(list tag attrs elements ...)
|
|
|
|
|
;; we insert a dummy element "◊" (irrelevant what it is)
|
|
|
|
|
;; to get a sample of the global attrs
|
|
|
|
|
;; which we will strip off after atomization
|
|
|
|
|
;; but keep the attrs around in case anyone needs to use them
|
|
|
|
|
;; for instance, quads added to the layout like footers
|
|
|
|
|
;; won't have another way of getting this
|
|
|
|
|
(list* tag attrs (cons "◊" elements))])))
|
|
|
|
|
|
|
|
|
|
;; apply some default styling attributes.
|
|
|
|
|
;; These will only be used if the underlying q-expression hasn't specified its own values,
|
|
|
|
|
;; which will naturally override these.
|
|
|
|
@ -194,6 +204,10 @@
|
|
|
|
|
#:emoji "fallback-emoji"
|
|
|
|
|
#:math "fallback-math"
|
|
|
|
|
#:font-path-resolver resolve-font-path!)]
|
|
|
|
|
[qs (let ()
|
|
|
|
|
;; store the dummy element and discard
|
|
|
|
|
(current-top-level-quad (car qs))
|
|
|
|
|
(cdr qs))]
|
|
|
|
|
[qs (time-log hyphenate (apply append (map handle-hyphenate qs)))]
|
|
|
|
|
[qs (map generic->typed-quad qs)]
|
|
|
|
|
[qs (drop-leading-breaks qs)]
|
|
|
|
|