I want to write a reader for multiple lightweight markup languages. It must only support pretty basic “rich text” features (bold, indent, lists, such things), complicated formatting and not-matching tags will be entirely ignored.
I don’t want to use a intermediate markup like pandoc does, since it should not convert but only display.
Which is why i thought of using a “mapping file” for each language. Guess it should support hierarchies, since formats like Markdown require context (prior line has this and next line that), so it will likely be in YAML/TOML/JSON.
Is this sufficient, or is there any better approach for simple addition of markup languages?
Or other projects doing similiar, i could learn from?
The context is a simple mbox/eml reader for a start (html and markdown), and the experience/ideas will be used in a bigger project later, with more language support.


Yes, but it should be easy to add support for other markup languages. Hence the mapping file. Since it’s not complex formatting, that should suffice, i think?
No, not in a browser or electron or similiar. It should be lightweight and quick to launch on any device.
I rephrased the post a bit.