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.
34 lines
1.2 KiB
Racket
34 lines
1.2 KiB
Racket
11 years ago
|
#lang racket/base
|
||
11 years ago
|
|
||
|
(require (only-in (planet mb/pollen/readability) ->list)
|
||
11 years ago
|
(only-in (planet mb/pollen/tools) trim)
|
||
11 years ago
|
(only-in (planet mb/pollen/predicates) whitespace?))
|
||
11 years ago
|
|
||
|
(provide (except-out (all-from-out racket/base) #%module-begin)
|
||
|
(rename-out [module-begin #%module-begin]))
|
||
|
|
||
|
(require (only-in scribble/text output))
|
||
|
|
||
|
(define-syntax-rule (module-begin expr ...)
|
||
|
(#%module-begin
|
||
|
|
||
|
; We want our module language to support require & provide
|
||
|
; which are only supported at the module level, so ...
|
||
|
; create a submodule to contain the input
|
||
|
; and export as needed
|
||
|
|
||
|
; doclang2_raw is a clone of scribble/doclang2 with decode disabled
|
||
|
; helpful because it collects & exports content via 'doc
|
||
11 years ago
|
(module pollen-inner (planet mb/pollen/lang/doclang2_raw)
|
||
|
(require (planet mb/pollen/tools) (planet mb/pollen/main-helper))
|
||
11 years ago
|
(require-and-provide-extras) ; brings in the project require files
|
||
11 years ago
|
|
||
|
expr ...) ; body of module
|
||
|
|
||
|
(require 'pollen-inner) ; provides 'doc
|
||
|
|
||
11 years ago
|
(define text (trim (->list doc) whitespace?)) ; if single line, text will be a string
|
||
11 years ago
|
|
||
|
(provide text (all-from-out 'pollen-inner))
|
||
|
|
||
|
(output text)))
|