COURSE / REAL PRACTICE
Publish a page from Markdown
Build a small documented Markdown parser and publish a styled single HTML page with explicit escaping, safe links and useful diagnostics.
Read the explanation and diagrams, then work through the practice. Your browser profile supplies your saved progress.
What you’ll work toward
Generate a complete responsive HTML page from an explicit Markdown subset, inspect its parsed structure and repeat the build with stable bytes and a SHA-256 digest. The standard-library lab includes source, template, fixtures, tests and an owned output directory.
Read an explanation, inspect the diagrams and work through the available checks, debugging exercises and builds. Feedback and prerequisite links guide the next step.
Before you start
This course builds on these skills:
Individual lessons can add prerequisites. Your lesson progress shows your actual readiness.
A look inside the first lesson
Define the language before writing the parser
source = "# Title\r\n\r\nParagraph\rnext line\n"
normalized = source.replace("\r\n","\n").replace("\r","\n")
print(repr(normalized))
print("same line count", normalized.count("\n"))Your lesson sequence
Follow the same units and lessons in either view. Prerequisite links and your practice progress stay with each lesson.
A small language with explicit boundaries
- LESSON 01.01
Define the language before writing the parser
Document the supported subset, normalize line endings and retain one-based source locations.
Open lesson - LESSON 01.02
Split blocks without losing code or locations
Recognize blank-separated headings, paragraphs, flat lists and fenced code while preserving source positions.
Open lesson - LESSON 01.03
Parse inline structure before generating HTML
Scan one line into text, code, emphasis and plain-label link tokens with exact source offsets.
Open lesson
Safe output and useful failures
- LESSON 02.01
Escape text and authorize link destinations
Render only controlled tags, escape text/attribute contexts separately and reject unsafe or ambiguous links.
Open lesson - LESSON 02.02
Fill a trusted template in one pass
Render known block kinds, preserve fenced code and substitute escaped title plus controlled body fragments without reinterpreting values.
Open lesson - LESSON 02.03
Report unsupported syntax at its source location
Compose the parser and renderer, distinguish source errors from configuration/programmer failures and return no partial page on failure.
Open lesson