@@ -48,12 +48,13 @@ "dust.rkt" "crystalize.rkt")))) ;; Macro for defining tag functions that automatically branch based on the ;; current output format and the list of poly-targets in the setup module. -;; -(define-syntax (poly-branch-tag stx) +;; Use this macro when you know you will need keyword arguments. +;; +(define-syntax (poly-branch-kwargs-tag stx) (syntax-parse stx [(_ TAG:id) (with-syntax ([((POLY-TARGET POLY-FUNC) ...) (for/list ([target (in-list (setup:poly-targets))]) (list target (format-id stx "~a-~a" target #'TAG)))] @@ -62,14 +63,14 @@ (define args (cons attributes elems)) (case (current-poly-target) [(POLY-TARGET) (apply POLY-FUNC args)] ... [else (apply DEFAULT-FUNC args)])))])) -;; Like above, but uses define instead of define-tag-function, so arguments -;; are given ‘straight’ rather than being parsed out as attributes. +;; 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-func stx) +(define-syntax (poly-branch-tag stx) (syntax-parse stx [(_ TAG:id) (with-syntax ([((POLY-TARGET POLY-FUNC) ...) (for/list ([target (in-list (setup:poly-targets))]) (list target (format-id stx "~a-~a" target #'TAG)))] @@ -99,18 +100,18 @@ (poly-branch-tag center) (poly-branch-tag section) (poly-branch-tag subsection) (poly-branch-tag code) (poly-branch-tag blockcode) -(poly-branch-tag verse) ; [#:title ""] [#:italic "no"] - -(poly-branch-func link) -(poly-branch-func url) -(poly-branch-func fn) -(poly-branch-func fndef) - -(poly-branch-tag note) +(poly-branch-kwargs-tag verse) ; [#:title ""] [#:italic "no"] + +(poly-branch-tag link) +(poly-branch-tag url) +(poly-branch-tag fn) +(poly-branch-tag fndef) + +(poly-branch-kwargs-tag note) ;; Not yet implemented ; (poly-branch-tag table) ; #:columns "" ; (poly-branch-tag inline-math) ; (poly-branch-tag margin-note)