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

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Feb 15 15:34:49 EST 2013

Does `collection-file-path' work?

Here's a small example:

 #lang scribble/base

 @image[(collection-file-path "heart.png" "icons")]


I think this is closer to your example (but untested):

 #lang scribble/base

 @(define (fig name)
    (collection-file-path name "book" "figures"))

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


At Fri, 15 Feb 2013 15:19:29 -0500, David Van Horn wrote:
> 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.