[racket] Creating Slides from a Racket file

From: Klaus Ostermann (klaus612 at gmail.com)
Date: Mon Oct 25 09:04:36 EDT 2010

Hi there,

I'm using Racket in a programming language course - more specifically
the PLAI language variant of it.

I'd like to have something like "lhs2tex"
for Racket.

More specifically, I'd like to have my sources in a format that is
executable but can also be used to create slides from the comments in
the file.

For instance, I'd like to have a source file that looks similar to this:

------------ begin source file


First order functions

F1WAE is a language with first-order functions.
* We use environments instead of substitution
* Another point
* Yet another important point

Its datatype is defined as follows:

> (define-type F1WAE
>   [num (n number?)]
>   [plus (lhs F1WAE?) (rhs F1WAE?)]
>   [with (x symbol?) (e1 F1WAE?) (e2 F1WAE?)]
>   [id (x symbol?)]
>   [app (f symbol?) (a F1WAE?)])

------------- end source file

I want to be able to execute this as normal Racket code (i.e. all text
is ignored), but I also want to be able
to create slides (or at least HTML) from comments and source-code.

Does something like this exist? I have found two related Racket
extensions: Slideshow and Scribble.
Slideshow does not seem to be the right tool since it is only for
creating slides and not for mixing code and documentation.
Scribble seems to require rather heavyweight markup (compared to
lhs2tex). I also don't know how to combine it
with the PLAI extension or how to create slides (rather than HTML).

- Klaus


Posted on the users mailing list.