Markterm: render markdown to the terminal

What it says in the box: just like Markd.to_html give you HTML, Markd.to_term gives you something that when printed to a terminal looks nice :slight_smile:

Works in light and dark terminals (and guesses if you are using a dark or light one!), does the right thing when piped, and in general tries to generate nice and not gaudy output.

Code at GitHub - ralsina/markterm

markterm-light
markterm-dark

Update: Just noticed I can combine this with Crycco, the literate programming tool I wrote, and …

12 Likes

Very nice! I have actually been looking for something like this. When playing around with it, however, I noticed that some special characters like the German “Umlaute (äöü)” are not rendered correctly.
Thanks for the cool shard! :slightly_smiling_face:

Just give me an example, happy to fix it while I still know how it works :-)

It seems to be working here, so it’s probably some bug in my locale/encoding handling (there is none ;-) )

2024-07-31_13-06

I tried again and it seems the error was on my end haha. The input text that I used (OpenAI API response) was already not correct. Sorry and thanks for the fast reply!

1 Like

Very nice work!
I like to see some terminal :heart:

There’s more coming :slight_smile:

It is blocking…

With it’s own README? Ouch, that’s the thing I test it against all the time :-D

Can you try current main? And/or maybe we can take it to Gitter?

Version 0.4.0 is out, and it’s (as far as I need it) feature complete. So, unless someone else (it has one user other than me AFAIK) and asks for something, this is it :-)

  • Supports images (even remote)
  • Supports code blocks
  • Supports HTML blocks (in a way: you get highlighted HTML)
  • Supports themes (and a separate theme for code)
  • It’ s packaged for Arch (because it’s easy!)
5 Likes

@ralsina thanks, with 0.4.0, | less -R now gives colors :grinning:

1 Like