Static Lesson Generators

Posted

Yesterday I tweeted:

Somewhere out there, in a timeline very close to ours, there are as many static site generators for lessons and courses as there are for blogs, and that design space has been as well explored.

and:

And somewhere, in an even better timeline, it’s normal and valued for grad students in software engineering to write detailed, theoretically-well-founded compare-and-contrast analyses of those design spaces.

I’m not going to attempt the latter here—doing it properly would take several months of research and careful thought—but after trying and failing for years to build a usable framework for lessons using Jekyll, I hope a sketch of how I think about static site generators and what I’d want from a lesson generator might be useful. To set the stage:

  1. In the beginning we wrote web pages by hand and put them in our htdocs directory so that our web server could share them with the world.

  2. We quickly realized that some content needed to be generated on the fly, so we created content management systems (CMSes) to parse the user’s HTTP request, look things up on disk or in a database, and generate HTML right then and there.

  3. But it turned out that a lot of sites didn’t need just-in-timeness, and that creating pages once and serving them many times put less load on the server and enabled caching, so we created static site generators (SSGs).

Every SSG I’ve used is built around templates that define how pages are laid out. These templates combine plain old HTML (which is copied verbatim) and code fragments that repeat some chunks, conditionally include other chunks, and/or insert data values into the generated pages. The SSG reads files containing content and configuration files containing commonly-used values like the site’s contact address and combines that information with the templates to produce the static pages making up the site.

I think any tool that does what’s described in the previous paragraph is an SSG in the same way that anything with feathers and a beak is a bird, but it’s a very large design space:

The paradigm of SSGs is a blog (where I used the word “paradigm” in the sense of something that serves as a defining exemplar). I have used them to create tutorial websites, but:

At this point you may be thinking, “But LaTeX! Or Bookdown!” In practice, they make some things easier but other things harder. But this blog post isn’t about designing a better static lesson generator. What I really want is an in-depth, peer-reviewed analysis of this design space. What are the paradigmatic needs that define “this design space”? What approaches have been taken in the past? What workarounds or shims have people evolved to handle needs that aren’t core?

And most importantly, why aren’t analyses like these a standard part of a software engineer’s education? The architects who live across the street from me have a shelf full of books that analyze buildings of differents and styles, from medieval cathedrals to modern Scandinavian bus shelters (which appear to have undergone the same kind of adaptive radiation as Darwin’s finches). They started to learn what had come before, why it was built the way it was, and how to think about it when they were 18 or 19. Fifteen years after Beautiful Code, I still struggle to find examples of software architects discussing software architecture with the same level of insight I would expect in an undergrad architect’s term paper on Union Station or an undergrad music student’s analysis of Gershwin’s “Rhapsody in Blue”.

Stroustrup’s Design and Evolution of C++ Ierusalimschy et al’s “Implemenation of Lua 5.0”, and Cooks Gitlet are proof that discussion of this kind is both possible and valuable at several levels; (Go ahead: spend half an hour with this page—you can thank me later.) If I really had any influence on software engineering education, every undergrad would read a couple of dozens essays like this in a third-year course and write at least two. As it is, I’m just going to keep ranting from the sidelines and hope that some day, somewhere, better becomes normal.