Proves the pieces compose: marked + handlebars + fs + path
together, all driven by ionpower-node, all synchronous, all on
PowerPC Tiger.
cd demos/ssg
../../node build.jsReads every *.md in input/, renders through marked, wraps in
template.hbs, writes to output/<name>.html.
Expected output is a handful of complete HTML pages with a shared
layout. The hello.md page includes code fences, blockquotes, lists,
and emphasis — so if all the marked features round-trip through the
template cleanly, the demo is working.
Smoke tests like test/marked_smoke.js and test/handlebars_smoke.js
verify each library in isolation. This demo is the composition test:
- Real fs I/O chain:
readdirSync(input/)→readFileSync(each)→writeFileSync(output/each). Exercises the sync-only filesystem promise in the shape a real build tool would use it. - Cross-module data flow: marked's output (HTML string) becomes
handlebars's
{{{body}}}input; no escaping mishaps. - path composition:
path.join(root, "input")pluspath.dirname(process.argv[1])— the natural shape of every "locate-files-relative-to-me" pattern. - Nontrivial
requireresolution: the demo lives indemos/ssg/, the vendored libs in../../test/vendor/. Our CommonJSrequirehas to walk..correctly.
On first run, unmeasured — roughly "under a second for three short pages," which includes spinning up the runtime, JIT-compiling marked and handlebars on load, and rendering. On subsequent invocations a warmed-up SpiderMonkey would be faster, but we don't run daemon- style yet.