[racket] Passing command-line parameters *into* Scribble

From: Daniel Prager (daniel.a.prager at gmail.com)
Date: Tue Dec 10 13:54:15 EST 2013

Hi Matthew

Thanks for clarifying, and the suggestion.

I'll give a bit more detail on my use-case, as a more concrete example for
any future enhancement, and in case there's an easier workaround than using
scribble/render, or my current hack (below).

Use-case: Consider a kind of mail-merge, in which I have a single scribble
"template" file, and multiple json files, each containing the data for
producing a single instance of the pdf.

My current workaround is to employ a wrapper scribble file, wrapper.scrbl

#lang scribble/base
> @include-section["template.scrbl"]


which I copy to the name of each json file -- e.g input.json motivates a
copy called input.json -- and use the filename commonality to suck in the
relevant data.

E.g. Say the data is in input.json:

*> cp wrapper.scrbl input.scrbl*
*> scribble --pdf --dest-name output.pdf input.scrbl*

which suffices, but a more elegant solution would be nice.

Naturally I'd prefer to be able to do something like

*> **scribble --pdf --dest-name output.pdf template.scrbl -- --input-name
input.json*

although a single flag would suffice in my use-case. E.g

*> **scribble --pdf **--json input.json **--dest-name output.pdf
template.scrbl*


Thanks

Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20131211/b57a2a77/attachment.html>

Posted on the users mailing list.