[racket] Separated slideshow slides into multiple files

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Nov 11 08:30:20 EST 2013

At Mon, 11 Nov 2013 18:46:31 +0800, 韩锴 wrote:
> As we have three people to create a slideshow. We separated the slides into
> three parts. Can I create files follows:

I usually organize multi-part slideshows as illustrated below, where
"talk.rkt" combines the "a.rkt" and "b.rkt" parts.

Each part has its own `slides` function, and a `main` module within
each part calls the function so that it's easy to try to the part by
itself.

The main "talk.rkt" imports each part module and calls part's `slides`
function.

In the below example, there's almost enough boilerplate to consider a
little language to generate it. In practice, though, the boilerplate is
small compared to the slide content, my slide modules often evolve to
export multiple `slides` functions with keyword arguments (to adapt the
slides to slightly different talks), I edit `main` to run subsets of
slides that I'm working on, etc.

; ----------------------------------------
; talk.rkt
#lang slideshow
(require "a.rkt"
         "b.rkt")

(a-slides)
(b-slides)


; ----------------------------------------
; a.rkt
#lang slideshow

(provide a-slides)

(define (a-slides)
  (slide (t "A")))

(module+ main
  (a-slides))

; ----------------------------------------
; b.rkt
#lang slideshow

(provide b-slides)

(define (b-slides)
  (slide (t "B")))

(module+ main
  (b-slides))



Posted on the users mailing list.