41 Render a larger project
For a slide video, start with the supplied runner. From the repository root:
racket slides/render-example.rkt --workers 10 \ |
--output slides-output/manual-videos \ |
scribblings/examples/slide-lesson.rkt |
The runner loads film, chooses matching color and text settings, prepares content, renders frames, and assembles the movie. For many lessons, that is all the project configuration you need.
The shell command is not executed while Scribble builds the manual. The pure project declaration and planning API below are executed.
41.1 Declare a project when you need more control
A project combines the source, render settings, output paths, and cache policy. A cache keeps previously rendered work for reuse; this example turns persistent caching off. A worker is another Racket process that renders assigned frames. Ten workers is a requested capacity, not a promise of a tenfold speedup.
The maintained complete project file lives next to "slide-lesson.rkt". Its storyboard-source form captures that source module’s directory:
scribblings/examples/project.rkt
#lang racket/base
(require animate/project animate/slides animate/slides/project)
(provide lesson-project)
(define lesson-project
(animate-project
#:id 'manual-lesson
#:source (storyboard-source "slide-lesson.rkt" 'film)
#:render
(render-spec #:fps 30 #:width 1280 #:height 720 #:workers 10
#:theme (slide-theme-colors lecture-light)
#:typography (slide-theme-typography lecture-light))
#:output (output-spec #:root "slides-output/manual-videos" #:name "function-lesson")
#:cache (cache-spec #:policy 'off)))
For the interactive documentation evaluator we spell the same source base explicitly with make-storyboard-source. This avoids depending on the synthetic source location of a Scribble example:
(define lesson-project (animate-project #:id 'manual-lesson #:source (make-storyboard-source "slide-lesson.rkt" 'film #:asset-base (path->complete-path "scribblings/examples")) #:render (render-spec #:fps 30 #:width 1280 #:height 720 #:workers 10 #:theme (slide-theme-colors lecture-light) #:typography (slide-theme-typography lecture-light)) #:output (output-spec #:root "slides-output/manual-videos" #:name "function-lesson") #:cache (cache-spec #:policy 'off)))
The declaration itself is immutable data:
> (animate-project? lesson-project) #t
> (render-spec-workers (animate-project-render lesson-project)) 10
The render theme and typography must agree with the storyboard. The example turns persistent caching off to make its behavior easy to follow.
41.2 Inspect the plan before writing files
plan-project is pure: it normalizes paths and describes the intended job without loading the declared source or writing output.
(define planned (plan-project lesson-project))
> (project-plan? planned) #t
prepare-project! is the next boundary: it may load the source and inspect required tools, but it does not render frames. The final render is a separate effect. The real calls are:
(eval:alts (prepare-project! planned) (void (lambda () (prepare-project! planned)))) (eval:alts (render-project! lesson-project) (void (lambda () (render-project! lesson-project))))
The manual displays the actual operations but evaluates only dormant lambdas for these environment-dependent stages. This keeps documentation builds independent of FFmpeg, output permissions, and project worker processes.
For command-line environment checks and individual-section output, see Project execution and cache details.
41.3 Math and geometry use the same worker pool
The parent prepares the mathematical and construction data once. Workers rebuild a sampler from that prepared data; they do not redo geometry realization or label placement. Workers still need compatible Racket, source files, and fonts. Static previews and video encoding are separate work.
Check the reported execution mode and actual worker starts. The probe runner compares pictures and repeatability; it is not a test of worker speed.
41.4 Finish with two kinds of review
Watch your lesson for pacing, wording, and readability. Separately, use Compare Pict and Scene output and keep the logs to compare the library’s Pict and Scene output. A completed file or a passing numeric comparison does not establish that a lesson communicates well.