On Sun, Sep 04, 2022 at 01:51:25PM +1000, Cameron Simpson <c...@cskk.id.au> wrote:
> Well, this has been quite the read. > > As a plain text person (aren't we all?) I find poor quality mail clients > annoying, as shown by the motivating screenshot of a plain text hard folder > message presenting on a narrow portrait mode mail reader. > > There seem to two approaches available: `format=flowed` which works well if > the mail reader supports it, and HTML which is a PITA to author for us. > > Having just got my `format=flowed` stuff working again after being broken > for a long time, and have been using some Discourse forums recently (via > email) which accept MarkDown, I've been filled with enthusiasm for MarkDown > email. And markdown's a decent source for basic HTML, since it's authoring > overhead is low and it is very readable in its raw form. > > So I've revisited the manual and found the `$send_multipart_alternative` > option and its friend `$send_multipart_alternative_filter`. They work well! > > So now I have a mechanism to send: `format=flowed` MarkDown with a aparallel > HTML alternative. The HTML should render in a "paragraphy" way for the HTML > people, and the MarkDown keeps me happy. > > My default setting is now: > > set send_multipart_alternative=no > set send_multipart_alternative_filter='echo text/html; echo; exec md2html' > > which is the inactive form, and I've added: > > message-hook . 'set send_multipart_alternative=no' > message-hook '%f htmlees' 'set send_multipart_alternative=no' Oops. That should be =yes above. > which will be turning it on for people in my (empty so far) "htmlees" mutt > group. I use a similar pattern (`%htmlers`) for preserring HTML over plain > text for certain messages. > > The `md2html` script is my personal script, which wraps `pandoc` and post > munges the HTML to indent the code blocks, which `pandoc`'s HTML does not > please my eye. It's here: > https://github.com/cameron-simpson/css/blob/main/bin-cs/md2html > if anyone wants a starting point. > > I'm probably going to bind a key to turn this mode on at some point. > > Cheers, > Cameron Simpson <c...@cskk.id.au> Thanks, Cameron. It's odd that there isn't an md2html program out there already. I had to create one too (using python's markdown module). I like your indenting of code blocks, but it seems to put an additional blank line after each code block. That might not be intentional. And it looks like it doesn't do titles (which default to "-"). I guess that doesn't matter for email use, except that pandoc whinges about it on stderr. Do you have any advice for automating spaces at the end of non-final paragraph lines for format=flowed in vim? Perhaps I could just post-process messages with perl in my mutt-editor wrapper script. cheers, raf