58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
58
59
60
61
62
63
64
65
66
67
68
69
70
|
-
-
-
+
+
|
(with-syntax ([((POLY-TARGET POLY-FUNC) ...)
(for/list ([target (in-list (setup:poly-targets))])
(list target (format-id stx "~a-~a" target #'TAG)))]
[DEFAULT-FUNC (format-id stx "html-~a" #'TAG)])
#'(define-tag-function (TAG attributes elems)
(define args (cons attributes elems))
(case (current-poly-target)
[(POLY-TARGET) (apply POLY-FUNC args)] ...
[else (apply DEFAULT-FUNC args)])))]))
[(POLY-TARGET) (POLY-FUNC attributes elems)] ...
[else (DEFAULT-FUNC attributes elems)])))]))
;; Like above, but uses `define` instead of `define-tag-function`.
;; Use this when you know you will not need keyword arguments.
;;
(define-syntax (poly-branch-tag stx)
|
99
100
101
102
103
104
105
106
107
108
109
|
98
99
100
101
102
103
104
105
106
107
108
|
-
+
|
(poly-branch-tag smallcaps)
(poly-branch-tag center)
(poly-branch-tag section)
(poly-branch-tag subsection)
(poly-branch-tag code)
(poly-branch-tag blockcode)
(poly-branch-kwargs-tag blockcode)
(poly-branch-kwargs-tag verse) ; [#:title ""] [#:italic "no"]
(poly-branch-tag link)
(poly-branch-tag url)
(poly-branch-tag fn)
|