[racket] 5.3.3, Scribble, (Scriblogify?), Plot, and Google's BlogSpot

From: Patrick King (slowthought at gmail.com)
Date: Wed Mar 20 11:10:08 EDT 2013

On Mon, Mar 18, 2013 at 8:45 PM, Ryan Culpepper <ryanc at ccs.neu.edu> wrote:

> Can you provide a small, self-contained test file?
>

Yes.


> #lang scribble/manual

> @title{Problems Uploading Scribbled Plots}

> @author{SlowThought}

> @(require racket/sandbox

>           racket/vector

>           scribble/eval)

> @(define my-space(call-with-trusted-sandbox-configuration

>                   (λ()

>                     (make-evaluator 'racket/base

>                                     (sandbox-output 'string)

>                                     (sandbox-error-output 'string)))))

> I am trying to post some examples of @racket{plot} to my blog...

> @(interaction

>   #:eval my-space

>   (require math plot)

>   (plot (function sin (- pi) pi #:label "y = sin(x)")))

>
When I use "Scribble HTML" from within DrRacket, the result is exactly as
you'd expect.

> When I use Scriblogify to upload the post to BlogSpot, the figure
generated by

> @racket{plot} is replaced by @racket{(object:2d-plot-snip% ...)}.

>
If I plot @italic{outside} an interaction,

> @(require math plot)

> @(plot (function cos (- pi) pi #:label "y = cos(x)"))

>
then things again work as expected locally. When uploading, I get...

>
@codeblock{C:...\Blog>raco scriblogify -p MyBlog "debug-plot.scrbl"

>            Warning: unmapped local image: "pict.png"}

>
This suggests a problem with my profile settings, although I have
intermittently

> gotten images to automatically upload. It's not terribly hard to manually

> upload them (for that matter, I could manually edit the
@racket{interaction}

> from within Blogspot), but things are @italic{so} close to being seamless!

>
Note that while the above renders perfectly via "Scribble HTML", if I
attempt to

> scriblogify without commenting out one of the plot commands,

> raco barfs up the following...

>
@codeblock{ C:...\Blog>raco scriblogify -p MyBlog "debug-plot.scrbl"

>            cannot instantiate `racket/gui/base' a second time in the same
process

>            context...:

>            C:\Program
Files\Racket\collects\mred\private\wx\common\once.rkt: [running body]

>            C:\Program
Files\Racket\collects\mred\private\wx\common\utils.rkt: [traversing imports]

>            C:\Program
Files\Racket\collects\mred\private\wx\win32\wndclass.rkt: [traversing
imports]

>            C:\Program
Files\Racket\collects\mred\private\wx\win32\init.rkt: [traversing imports]

>            C:\Program
Files\Racket\collects\mred\private\wx\win32\platform.rkt: [traversing
imports]

>            C:\Program Files\Racket\collects\mred\private\wx\platform.rkt:
[running body]

>            C:\Program Files\Racket\collects\mred\private\kernel.rkt:
[traversing imports]}

>
Looking over the above, I withdraw my 5.3.3 complaint. The intermittent
image upload problem may be

> a profile problem of mine. Scriblogify's balking at plots both inside and
outside an interaction is a

> new (to me) quirk.

>
As always, thanks to the community for all your help.

>
@; End of "debug-plot.scrbl"
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130320/c39cfd62/attachment-0001.html>

Posted on the users mailing list.