4 ms·
I wish we had something like Markdown for email--to me that would be the sweet spot between the mess HTML email has become, and plain text which sometimes does
by contingencies 10y ago
I wish we had something like Markdown for email--to me that would be the sweet spot between the mess HTML email has become, and plain text which sometimes does lack in its ability to communicate information.
I don't use mutt but IIRC a basic feature of both mutt and similar (pine + variants, etc.) is allowing you to define your own external editor. Therefore, there's nothing to stop you adding a wrapping pipeline to that so that, for example, first you edit normally in your preferred editor, and second an established piece of code or basic series of regex replaces your markdown with whatever you actually want. Optionally, the reverse runs before editing. This should not take longer than a few hours on the outside to get running comfortably.
- apatters 10y agoI can't believe I never thought of this! Brilliant idea. Now just to solve the viewing problem...
- contingencies 10y agoThe reverse should work for simple HTML. For complex HTML to plain text try https://www.google.com/search?q=lynx+convert+html+text https://www.google.com/search?q=lynx+convert+html+text .. most text browsers can do a reasonable job of it.
- Steltek 10y agoUsing lynx (or elinks, in my case) to view HTML email in mutt is the historical solution. I think the desire here is for a reversible transformation. E.g. I can receive an HTML email, view it as Markdown, reply using Markdown, and then send an HTML email in reply. Unfortunately, I think foreign email clients would mangle the HTML just enough to stop this from working. You'd have to start implementing a tag soup type parser to coax incoming mail into something intelligible.
- dredmorbius 10y agoWe're almost at that stage with HTML already. I'm thinking that a multi-pass parser: 1. Is this sane HTML5 markup? I'll eat that. 2. Is this a borked-but-manageable variant? Strip the cruft. 3. Is this Beyond All Hope? Just dump it as ASCII. It'll be blockquoted in reply. HTML is no longer a peresistent, stable, or universal interchange format.
- nextos 10y agoWell you can use pandoc too or w3m.
- tmerse 10y agoFor some HTML mails, it is sufficient to use a mailcap file in combination with lynx or w3m: # ~/.mutt/mailcap text/html; w3m -I %{charset} -T text/html; copiousoutput; # ~/.muttrc alternative_order text/plain text/enriched text/html # save html for last auto_view text/html If you want the full HTML experience, you can use this script [1], which uses python (there also is an older bash version) to convert the mail into standalone html to be viewed inside a browser. # ~/.muttrc macro index,pager M "<enter-command>unset resolve<enter><clear-flag>N<enter-command>set resolve<enter><pipe-message>viewhtmlmail\n" "View HTML in browser" 1: https://github.com/akkana/scripts/blob/master/viewhtmlmail https://github.com/akkana/scripts/blob/master/viewhtmlmail
- chongli 10y agoHow about using Pandoc[0] as part of your wrapping pipeline? It supports the full round trip between markdown, HTML, and back. Seems like this would be a perfect use case for it. [0] http://pandoc.org http://pandoc.org
- RaitoBezarius 10y agoThis is insanely brilliant. I am now happy to use Mutt again.
- nextos 10y agoYeah, I came here to suggest pandoc too. You can easily script mutt to include a plaintext file and an html one generated by pandoc, so that people reading your emails can fall back to a plain text version of your mails in case they can't view html.
- atsaloli 10y agoIf you folks have already done the legwork on this, could you please publish your setup?
- tome 10y agoYes please! This sounds intriguing. I send plain text only from mutt but including HTML from Markdown via Pandoc would be very cool.
- tmerse 10y agoHere is what I use. # convert markdown to html via pandoc # https://unix.stackexchange.com/questions/108485/send- email-written-in-markdown-using-mutt macro compose \e5 "F pandoc -s -f markdown -t html \ny^T^Utext/html; charset='utf-8'\n"
- atsaloli 10y agoThanks!
- astrobe_ 10y agoI think you are solving the wrong problem. The problem isn't HTML, it is its users. People who can't quote properly, people who end every single sentence with an emoji, etc. In a nutshell, people who have never experienced Usenet never learned how to communicate properly with a keyboard. The fix for this is to configure your email client to auto-answer a rejection message when it receives anything other than plain text. You can always blame your antivirus for that. Help people with disabling HTML email. With a little bit of luck, they won't remember how to enable it again. And hopefully, since they won't be distracted any more with fancy formatting, animated smiley and which GIF-meme-to-use-for-this, hopefully they'll focus on words and reinvent ascii art.
- gnuarch 10y agoMany people use Android Mail which cannot send mail in text/plain if i understand correctly https://code.google.com/p/android/issues/detail?id=8712 https://code.google.com/p/android/issues/detail?id=8712
- Steltek 10y agoIs this kind of condescending, elitist remark destroying one of the few last redeeming qualities of email? That everyone can talk to everyone else outside of walled gardens? Don't get me wrong, I'm a big fan of plaintext email (and use mutt at work) but it's not practical to expect the world to bend to your own narrow choices in technology so harshly. The attitude displayed here is, quite frankly, disgusting.
- kstrauser 10y agoThat's nice, grandpa. I'm probably physically older than you, but I mostly commonly see your attitude when I'm sipping beer with old vets down at the Elks lodge. Just because we invented and pioneered the early 'net doesn't mean we own it. Things change and usage patterns evolve as people join and leave the medium. Email today is a medium for HTML and emojis for almost everyone using it, except for the curmudgeons. We don't get to define "communicates properly". Don't be a curmudgeon. This isn't "our" system anymore, if it ever was at all.
- apatters 10y ago