mdPages (Static Site Generator from Markdown)

Phase 1 — Core Markdown to HTML Conversion

  • Implement a parser that converts some basic Markdown syntax to HTML:
    • Headings (#, ##, ###)
    • Bold, italic, links, lists
    • Paragraphs and line breaks
  • Support processing a single file or a folder of .md files
  • Validate input paths and handle missing files gracefully

Functional result: given a markdown file or folder, the program generates corresponding HTML files in an output folder, preserving folder structure.


Phase 2 — CLI and Folder Processing

  • Create a command-line interface for your tool:

    • Specify input folder and output folder
    • Option to overwrite existing HTML files or skip them
  • Process multiple .md files recursively (in the case of nested folders)

  • Maintain relative folder structure in output

Functional result: user can run the program on a folder of markdown files, and the folder structure + HTML files are correctly generated.


Phase 3 — Serve Site Locally

Add a simple HTTP server to serve generated HTML:

  • Option to choose port in the CLI
  • Serve HTML files with relative links correctly
  • Refresh automatically if the server restarts
  • Generate an index.html for folders, listing all contained pages

Functional result: user can run the generator and start a local server, then open a browser to view the generated site.


Phase 4 — Robustness & Minor Enhancements

  • Include a CSS file, imported by all the generated HTML files, and add some styling.
  • Handle common errors (missing files, invalid markdown) gracefully
  • Support extra markdown features (inline code, blockquotes)
  • Clear console messages/logging for processed files

Functional result: program reliably converts files, preserves folder structure, serves HTML locally, and handles errors cleanly.