Show HN: Learning Rust by writing a Markdown to HTML compiler
21 hours ago
- Andrea, new to Rust, built a simple .md to .html compiler as a practical project, moving away from Hugo due to its complexity.
- The compiler was created in 12-13 hours without GenAI tools, relying on documentation and basic markdown syntax implementation.
- Compilation involves scanning the posts directory, parsing block and inline elements, building an AST, and outputting HTML with basic templates.
- Posts require YAML front matter with title and date; optional fields include description, tags, and draft status.
- CommonMark coverage includes headings, paragraphs, code blocks, lists, blockquotes, inline formatting, links, and images.
- The index.html displays all posts with search and tag filtering, plus vim-like navigation for browsing.
- The project is intended for personal use but was a fun learning experience.