[racket-dev] Scribble: feature request - module paths for image

From: David Van Horn (dvanhorn at ccs.neu.edu)
Date: Fri Feb 15 15:19:29 EST 2013

On 2/15/13 10:47 AM, Jay McCarthy wrote:
> Does define-runtime-path work?

Yes, for some value of "yes".

This works (specific to my context, but easy to generalize):

#lang scribble/base
@(require racket/runtime-path)
@(require (for-syntax racket/base))

@(define-runtime-module-path-index id 'book)
@(define (fig name)
   (path->string
    (resolved-module-path-name
     (module-path-index-resolve
      (module-path-index-join (format "figures/~a" name) id)))))

@image[#:suffixes '(".png" ".pdf")]{@fig{quick-lists1}}


So for now my problem is solved, but

a) am I making this more complicated than needed?
b) if not, should it really be this complicated?

Thanks,
David



Posted on the dev mailing list.