[racket-dev] conditional scribble documents

From: Danny Yoo (dyoo at cs.wpi.edu)
Date: Wed Apr 25 19:03:38 EDT 2012

On Wed, Apr 25, 2012 at 6:38 PM, Matthias Felleisen
<matthias at ccs.neu.edu> wrote:
> For HtDP/2e, I use plain old conditionals and variables.
> I used to set an environment variable when I ran a shell
> script. Then I converted everything to Racket and set
> variables according to shell arguments:
>  $ ./xhtml draft
> creates the draft version of HtDP/2e by setting a *draft
> variable to #t and in other places I simply write
>  @(if *draft "Draft" "Release")
> and such. -- Matthias

I know I can always hack around Scribble limitations.    I can always
do a trick that LaTeX users know: to create a named file that acts
like a flag and use the InputIfFileExists LaTeX macro.  But I always
feel very dirty when I do that: I feel like I'm unable to communicate
intent to my tools when I take back-channels like that.

Conditional generation is a common use case.  In particular, the use
case I'm considering directly affects the Bootstrap curriculum work
I'm doing in the summer: we need to generate documentation for both
students and teachers, and we'd really like to use the same source

As such, I'd really like a good way to set up parameterizations in a
way that's directly supported by the Scribble command line tool.  The
scribble tool is hardcoded to set up certain parameterizations, such
as current-render-mixin, through its command line arguments.  I'd like
that facility to be open to extension.

Posted on the dev mailing list.