#lang racket/base (require pollen/setup scribble/reader racket/pretty version/utils racket/port racket/string) (provide (all-defined-out)) (define current-top-path (make-parameter #f)) (define (show doc parser-mode here-path) ;; we only want the top doc to print in the runtime environment ;; otherwise if a Pollen source imports others, they will all print their docs in sequence. ;; so only print if the current here-path is the top path, which is stored in the `current-top-path` parameter. (let ([ctp (current-top-path)]) (when (and ctp (equal? here-path ctp)) (if (memq parser-mode (list default-mode-preproc default-mode-template)) (display doc) ;; #:newline option for `pretty-print` was introduced in 6.6.0.3, ;; so trim trailing newline manually (let ([pretty-print-proc (if (version