Letters from a Maladroit

Hello Universe - Part 3: Static pages

With the exception of the API, all example/exercise pages are generated as static HTML pages. The major influences for this decision were based off my experience using Jekyll and Khan Academy’s old exercise framework. There are a lot of static page generators out there. Even I developed one two years ago using node.js and markdown no less. One of the draws is that they’re fast and easy to develop - far simpler than the traditional CRUD blog that people build when learning a new web framework or programming language.

Reasons to use static page generation for Hello Universe

Potential issues with static page generation for Hello Universe

The downsides are good problems to have actually. They are problems that would indicate that the site is gaining some traction, and would make a transition to a more traditional web framework worthwhile. For Hello Universe, building a CMS would be a premature optimization considering the effectiveness of static page generation.

File format rules

A Java example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
---
title: Hello Universe
tags: string
exercises: |
    1. Make this program print **Hello Universe** one time instead of two.
    2. Make the program print:<br /><br />
    **Hello Universe**

output: |
    Hello Universe
    Hello Universe
...
*/

class HelloUniverse
{
    public static void main(String[] args)
    {
        System.out.println("Hello Universe");
        System.out.println("Hello Universe");
    }
}

A C++ example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
---
title: Hello Universe
tags: string
exercises: |
    1. Make the program print:<br /><br />
        **Hello World**

output: |
    Hello Universe
...
*/

#include <iostream>

int main()
{
    std::cout << "Hello Universe";
}

Notes on the build script

If you’re interested in contributing to the project, feel free to fork the repository and send a pull request on Github.

* My tentatively titled “Java Examples” and later “Code Examples” project is now named “Hello Universe.”