HACKER Q&A
📣 auraham

Learning how to convert Markdown to HTML


A few days ago I read this article [1] where someone explained why he built his own static site generator (SSG).

The post is an interesting reading. However, I was impressed by the comments: there is a large amount of people that write their own SSG tool set rather than using (and modifying) an existing framework.

I understand the feeling, creating an SSG is a good project for learning a new programming language. Given that, I would like to ask you for resources about converting Markdown to HTML, maybe something like [2] or a relatively-small sized project like [3].

[1] https://news.ycombinator.com/item?id=28837760

[2] https://interpreterbook.com/

[3] https://pypi.org/project/Markdown/


  👤 version_five Accepted Answer ✓
Pandoc? That is how I generate html. You can use an arbitrary css stylesheet with it to get the look you want, and if you want to customize something it has a built on capacity for writing lua code to adjust how it parses the markdown

👤 gerardnico
markdown is not a language that can be expressed with a grammar file. I would take a look at the specification, they have created an implementation and explained it in details. https://spec.commonmark.org/0.30/#appendix-a-parsing-strateg...