So I'm working with DrRacket and since I'm making a manual via #lang scribble
for my procedures I'd like to put actual examples of my procedures running using @interactions
So far I've got this part:
#lang scribble/manual
@(require (for-label racket))
@(require scribble/eval racket/sandbox)
@(define my-evaluator
(parameterize ([sandbox-output 'string]
[sandbox-error-output 'string])
(make-evaluator 'racket/base '(define (f) later) '(define later 5))))
And when I do
@interaction[#:eval my-evaluator]{
@(f)
}
and then I run scribble --htmls ++main-xref-in manual.scrbl
it correctly renders as:
> (f)
5
Is there a way to use all my definitios (that are in a different file) to evaluate using scribble? I've tried changing the line 7 for :
(make-evaluator 'racket/base '(define (f) later) '(define later 5) #:require "mydefs.rkt")))
But when I try to render it, it throws something like this:
make-evaluator: bad requires: "mydefs.rkt"
I don't want to copy paste my definitions in the make-evaluator
part (they're a lot!) any fix? Thank you racketeers!
asumu from IRC #racket helped me with this. All I needed was to do this:
Note that instead of using keywords I just quoted the require statement.
Using
Renders perfectly.
Thanks!