A lightweight static site generator written entirely in Python. It converts Markdown (.md) files into full HTML pages using a custom-built Markdown parser, HTML node tree, and recursive file generation system — no external libraries required.
- Custom Markdown Parses
- Supports:
- Headings (
# syntax)- Paragraphs
- Code blocks (```)
- Blockquotes (
>) - Ordered and unordered lists
- Inline formatting (
**bold**,_italic_,`code`) - Links (
[text](url)) - Images (
) - 🧩 HTML Node Tree System
- Uses
HTMLNode,ParentNode, andLeafNodeclasses to represent and render HTML elements programmatically.
-
Recursive Site Builder
- Walks through your
/contentdirectory, converts every Markdown file to HTML, and applies a shared HTML template.
- Walks through your
-
Template Rendering
- Injects Markdown-generated HTML and page titles into an HTML template (
template.html) using placeholders:{{ Title }} {{ Content }}
- Injects Markdown-generated HTML and page titles into an HTML template (
-
No Dependencies
- Built entirely with the Python 3 standard library — no external packages required.
-
Fully Unit Tested
- Comprehensive tests for Markdown parsing and HTML generation ensure reliability.
-
Parse Markdown → Blocks
Splits Markdown into blocks (paragraphs, code, lists, etc.) and detects their type. -
Convert Blocks → HTML Nodes
Builds a tree ofParentNodeandLeafNodeobjects representing the HTML structure. -
Render HTML
Recursively renders all nodes into HTML strings. -
Inject into Template
Inserts the rendered HTML and page title intotemplate.html. -
Generate Output
Writes final pages into the/docsdirectory, preserving the folder structure.
# Hello World
Welcome to **my site**!
> A simple quote.
- Item 1
- Item 2
This is what the output would look like:
<h1>Hello World</h1>
<p>Welcome to <b>my site</b>!</p>
<blockquote>A simple quote.</blockquote>
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
<img src="logo.png" alt="Logo" />