You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pollen/runtime-config.rkt

23 lines
722 B
Racket

#lang racket/base
(provide configure)
(module show racket/base
(require pollen/world)
(provide show show-enabled)
(define show-enabled (make-parameter #f))
(define (show doc parser-mode)
(when (show-enabled)
(if (or (equal? parser-mode world:mode-preproc)
(equal? parser-mode world:mode-template))
(display doc)
(print (with-handlers ([exn:fail? (λ(exn) ((error '|pollen markup error| ((dynamic-require 'racket/string 'string-join) (cdr ((dynamic-require 'racket/string 'string-split) (exn-message exn) ": ")) ": "))))])
((dynamic-require 'txexpr 'validate-txexpr) doc)))))))
(require 'show)
(define (configure data)
(show-enabled #t))