scribble-enhanced/pkgs/scribble-pkgs/scribble-lib/scribble/lp-include.rkt
Jay McCarthy 8a8a54fec9 Add CHUNK
original commit: 05128592353ba81d378afb55ebb9724cfd8aecc4
2013-08-08 12:43:21 -06:00

21 lines
581 B
Racket

#lang scheme/base
(require scheme/include (for-syntax scheme/base)
(only-in scribble/private/lp chunk CHUNK)
scribble/manual)
(provide lp-include)
(define-syntax (module stx)
(syntax-case stx (#%module-begin)
[(module name base (#%module-begin body ...))
#'(begin body ...)]
[(module name base body ...)
(raise-syntax-error #f "missing #%module-begin" stx)]))
(define-syntax (lp-include stx)
(syntax-case stx ()
[(_ name)
(with-syntax ([there (datum->syntax stx 'there)])
#'(include-at/relative-to here there name))]))