Developer Tools

Static Site Generator

A Python static site generator with a hand-written Markdown parser, HTML node tree, recursive page generation, and unit tests.

A Python static site generator that turns a folder of Markdown files into a deployable HTML site. I built it from scratch to understand the mechanics behind tools like Hugo, Jekyll, and Astro at a lower level: parsing content, building an intermediate representation, applying a template, copying assets, and writing static files to disk.

What I implemented

The generator walks the content/ tree recursively and emits matching .html files into docs/, while preserving the nested route structure. Static assets are copied into the output folder, and the base path can be passed from the command line so generated links work on hosted paths as well as local paths.

The Markdown parser is also hand-written. It splits documents into block nodes, classifies headings, paragraphs, code blocks, quotes, ordered lists, and unordered lists, then parses inline markup for bold, italic, code, links, and images. Those nodes render through a small HTMLNode tree rather than ad-hoc string concatenation.

Why it matters

The project is intentionally minimal, but it forced me to define the boundaries between parsing, rendering, filesystem traversal, and templating. The unit tests cover block parsing, inline parsing, node rendering, and title extraction, which made the implementation much easier to evolve without breaking earlier Markdown cases.