Trilarion / opensourcegames

Technical infos of open source games.
https://trilarion.github.io/opensourcegames/
Creative Commons Zero v1.0 Universal
631 stars 78 forks source link

Implement more of a Markdown parser and be able to read and write entries without loss #247

Closed Trilarion closed 4 years ago

Trilarion commented 4 years ago

The current way of parsing the markdown parsing is very simple and heavily relies on regular expressions. Other markdown parsers are doing the same, but we should try to import and export the entries more generically, to allow for a greater flexibility of the format.

I wonder what can be learnt from other Markdown parsers (ignoring the rendering part) out there. We have:

Trilarion commented 4 years ago

Since we are only supporting a subset of Markdown, but on the other hand, have some special conventions on top of Markdown, I will use a general purpose parser (currently testing Lark) and write my special grammar for the database entries, the developer and originals file as well.

Trilarion commented 4 years ago

With Lark and a custom grammar I could solve the problem and can ready and write my special Markdown now. I can also extend the structure later on.