Skip to content

Commit

Permalink
Fix loading cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
otherjoel committed Jul 3, 2020
1 parent 84ebecf commit 7208467
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
10 changes: 5 additions & 5 deletions pollen-local/polytag.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(require pollen/tag pollen/setup)
(require (for-syntax racket/syntax
syntax/parse
pollen/setup))
"target.rkt"))

(provide (all-defined-out))
(provide poly-branch-tag)
Expand Down Expand Up @@ -51,7 +51,7 @@
; tag function with no special arguments or defaults
[(_ TAG:id)
(with-syntax ([((POLY-TARGET POLY-FUNC) ...)
(for/list ([target (in-list (setup:poly-targets))])
(for/list ([target (in-list poly-targets)])
(list target (format-id stx "~a-~a" target #'TAG)))]
[DEFAULT-TARGET (format-id stx "html-~a" #'TAG)])
#'(define-tag-function (TAG attributes elems)
Expand All @@ -62,7 +62,7 @@
; tag function with no positional arguments but with specified defaults
[(_ TAG:id ATTRS:keyval ...+)
(with-syntax ([((POLY-TARGET POLY-FUNC) ...)
(for/list ([target (in-list (setup:poly-targets))])
(for/list ([target (in-list poly-targets)])
(list target (format-id stx "~a-~a" target #'TAG)))]
[DEFAULT-TARGET (format-id stx "html-~a" #'TAG)])
#'(define-tag-function (TAG attributes elems)
Expand All @@ -74,7 +74,7 @@
; tag function with one positional argument and no defaults
[(_ TAG:id ARG:id)
(with-syntax ([((POLY-TARGET POLY-FUNC) ...)
(for/list ([target (in-list (setup:poly-targets))])
(for/list ([target (in-list poly-targets)])
(list target (format-id stx "~a-~a" target #'TAG)))]
[DEFAULT-TARGET (format-id stx "html-~a" #'TAG)])
#'(define-tag-function (TAG attributes elems)
Expand All @@ -86,7 +86,7 @@
; tag function with one positional argument and specified defaults
[(_ TAG:id ARG:id ATTRS:keyval ...+)
(with-syntax ([((POLY-TARGET POLY-FUNC) ...)
(for/list ([target (in-list (setup:poly-targets))])
(for/list ([target (in-list poly-targets)])
(list target (format-id stx "~a-~a" target #'TAG)))]
[DEFAULT-TARGET (format-id stx "html-~a" #'TAG)])
#'(define-tag-function (TAG attributes elems)
Expand Down
8 changes: 8 additions & 0 deletions pollen-local/target.rkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#lang racket/base

;; Breaking the loading cycle
;; Can no longer do (require (for-syntax pollen/setup)) in anything used by pollen.rkt
;; See https://github.com/mbutterick/pollen/issues/229

(define poly-targets '(html pdf))
(provide poly-targets)
8 changes: 4 additions & 4 deletions pollen.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
(provide for/s)

(module setup racket/base
(provide (all-defined-out))
;; Possible target output formats
(define poly-targets '(html pdf))
(require "pollen-local/target.rkt")
(provide (all-defined-out)
poly-targets)

;; Specify additional files for the Pollen server to watch
(require syntax/modresolve racket/runtime-path)
(define-runtime-path util-date.rkt "util-date.rkt")
Expand Down

0 comments on commit 7208467

Please sign in to comment.