Use `for-syntax` to import into the transformer environment:
#lang scribble/base
@(require (for-syntax racket/base
(only-in scribble/reader
make-at-reader)))
@(require racket/include)
foo
@(include/reader "si1.inc" (make-at-reader))
bar
The result of `make-at-reader` starts in S-expression mode where `@`
switches to text mode. You may want "si1.inc" to start out in text
mode, more like `#lang scribble/base`. That's almost as easy as
`(make-at-reader #:inside? #t)`, except that the reader in "inside"
mode returns an empty list for an empty input stream, which doesn't
work quite the right way for `include/reader`. Here's one way to adapt
it:
@(include/reader "si1.inc"
(lambda (src in)
(cond
[(eof-object? (peek-byte in))
eof]
[else
(cons #'begin
((make-at-reader #:inside? #t) src in))])))
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
racket-users...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/racket-users/20200406222722.2dvly3zgoi46iack%
>
40topoi.pooq.com.