this post was submitted on 29 Jan 2026
9 points (100.0% liked)

Programming

24878 readers
152 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
 

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 file 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.

top 2 comments
sorted by: hot top controversial new old
[โ€“] e0qdk@reddthat.com 1 points 2 days ago (1 children)

Are you trying to write your own parsers for these formats or something like that? I don't think I really get the issue you're running into.

If you want to just display formatted text (esp. including HTML), you can use a browser (either as an embedded widget in a custom app, via an Electron app, or in a regular browser via an HTTP server) and generate the output on the fly. You don't need to save the converted output if it's fast enough to generate...

[โ€“] MonkderVierte@lemmy.zip 1 points 2 days ago* (last edited 2 days ago)

Are you trying to write your own parsers for these formats

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.