Re: Using raco/all-tools to run scribble

Stephen De Gabrielle <[email protected]>
Newsgroups gmane.comp.lang.racket.user,gmane.lisp.scheme.plt
Message-ID <CAGHj7-LmtEfKixSubMS8nCkwwcFr2wzk_FgHSW72Gn2cG4cBgA@mail.gmail.com>
Thank you!

Stephen

On Thu, 10 Jan 2019 at 15:15, Shu-Hung You <
[email protected]> wrote:

> On Wed, Jan 9, 2019 at 8:08 PM Stephen De Gabrielle
> <[email protected]> wrote:
> >
> > I've cobbled together some code to run scribble by using all-tools but
> it only generates my file once - subsequent calls (using the function
> below) don't generate a new file.
> >
> > my log
> > (XX: scribble/run #(--html
> /Users/spdegabrielle/Dev/clash/scribble/mouse.scrbl)
> /Users/spdegabrielle/Dev/clash/html/)
> >  [Output to mouse.html]
> > (XX: scribble/run #(--html
> /Users/spdegabrielle/Dev/clash/scribble/mouse.scrbl)
> /Users/spdegabrielle/Dev/clash/html/)
> > (XX: scribble/run #(--html
> /Users/spdegabrielle/Dev/clash/scribble/mouse9.scrbl)
> /Users/spdegabrielle/Dev/clash/html/)
> >
> >
> > Does anyone have any idea why it only runs once?
> >
> >
> http://docs.racket-lang.org/raco/command.html#%28def._%28%28lib._raco%2Fall-tools..rkt%29._all-tools%29%29
> >
> >
> > #(--html /Users/spdegabrielle/Dev/clash/scribble/mouse.scrbl)
> >  [Output to mouse.html]
> >
> >
> > #(--html /Users/spdegabrielle/Dev/clash/scribble/mouse.scrbl)
> >
> >
> > (require raco/all-tools)
> > ;;scribble-to-html : source target body
> > ;; generate html file from scribble file
> > (define (scribble-to-html source target)
> >   (define raco-scribble-spec (hash-ref (all-tools) "scribble"))
> >   (parameterize
> >       ([current-command-line-arguments (vector "--html" (path->string
> source))]
> >        [current-directory target])
> >     (dynamic-require (cadr raco-scribble-spec) #f)))
> >
>
> Here, dynamic-require instantiates the required module in the current
> namespace. If the given module is already instantiated, nothing will
> happen. One solution is to create a new namespace using
> make-base-namespace and dynamic-require in that namespace:
>
> (parameterize ([current-namespace (make-base-namespace)]
>                         [...])
>   (dynamic-require ...))
>
> > --
> > 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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
> > For more options, visit https://groups.google.com/d/optout.
>
-- 
----

-- 
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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.