Rendering HTML as Markdown in mutt (was: Creating HTML emails with mutt)
Regarding the following, written by "Derek Martin" on 2019-10-31 at 15:39 Uhr -0500: And FWIW, I *was* discussing (very limited, completely text-based) support for HTML messages in Mutt. I want it, have wanted it for a long time, because all of the available options for dealing with it have serious drawbacks at least some of the time. Hey Derek, Could you please elaborate a bit on what you're missing? With `auto_view text/html` and adding [`~/.mutt/mailcap.htmldump`](https://git.madduck.net/etc/mutt.git/blob_plain/HEAD:/.mutt/mailcap.htmldump) to your `muttrc`'s `mailcap_path` setting, and then dropping [`~/.mutt/htmldump`](https://git.madduck.net/etc/mutt.git/blob_plain/HEAD:/.mutt/htmldump) in place, along with [`python-html2text`](https://pypi.org/project/html2text/), and you should get Markdown, more or less, which is precisely what it was designed for. -- @martinkrafft | https://riot.im/app/#/room/#madduck:madduck.net i welcome your constructive criticism and corrections. spamtraps: madduck.bo...@madduck.net digital_signature_gpg.asc Description: Digital GPG signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)
Re: Rendering HTML as Markdown in mutt (was: Creating HTML emails with mutt)
> Regarding the following, written by "Derek Martin" on 2019-10-31 at 15:39 Uhr > -0500: > > And FWIW, I *was* discussing (very limited, completely text-based) > > support for HTML messages in Mutt. I want it, have wanted it for a long > > time, because all of the available options for dealing with it have > > serious drawbacks at least some of the time. martin f krafft writes: > Could you please elaborate a bit on what you're missing? > > With `auto_view text/html` and adding > [`~/.mutt/mailcap.htmldump`](https://git.madduck.net/etc/mutt.git/blob_plain/HEAD:/.mutt/mailcap.htmldump) > to your `muttrc`'s `mailcap_path` setting, and then dropping > [`~/.mutt/htmldump`](https://git.madduck.net/etc/mutt.git/blob_plain/HEAD:/.mutt/htmldump) > in place, along with > [`python-html2text`](https://pypi.org/project/html2text/), and you should > get Markdown, more or less, which is precisely what it was designed for. That sounds like it's all on the viewing side? I can't speak for Derek, but in addition to viewing HTML messages, I (and others who have added to this thread) would like a way to reply without losing the formatting. The viewing side isn't so hot either. Most terminal programs these days can display colors, italics, bold, underline and strikethrough (looks like urxvt doesn't do strikethrough and xterm doesn't do underline, but those might not be too hard to patch in). So why do most HTML->text conversion programs ignore styles and colors in --dump mode? Is there one that shows styles/colors? Sure, it's easy enough to bind a key to bring up a browser window showing the message. But then I have an extra GUI window that isn't part of mutt, and it breaks that nice fast keyboard-driven workflow that's a big part of why I use mutt in the first place. It would be so nice to have it all right there in the pager. ...Akkana
Re: Rendering HTML as Markdown in mutt (was: Creating HTML emails with mutt)
On Fri, Nov 01, 2019 at 12:21:15PM +1300, martin f krafft wrote: > Regarding the following, written by "Derek Martin" on 2019-10-31 at 15:39 Uhr > -0500: > > And FWIW, I *was* discussing (very limited, completely text-based) > > support for HTML messages in Mutt. I want it, have wanted it for a long > > time, because all of the available options for dealing with it have > > serious drawbacks at least some of the time. > > Hey Derek, > > Could you please elaborate a bit on what you're missing? I and others have already done so, in some cases in some detail, throughout this thread. On Thu, Oct 31, 2019 at 06:55:26PM -0600, Akkana Peck wrote: > That sounds like it's all on the viewing side? I can't speak for > Derek, And yet you have done so successfully. :) > but in addition to viewing HTML messages, I (and others who have > added to this thread) would like a way to reply without losing the > formatting. > > The viewing side isn't so hot either. Most terminal programs > these days can display colors, italics, bold, underline and > strikethrough (looks like urxvt doesn't do strikethrough and xterm > doesn't do underline, Xterm most definitely does underline, though you may need to set a resource to make it do that. I vaguely recall that some text formats are rendered using colors or reverse text *by default* but can be made to do the more correct thing via X resources. I just don't recall the specifics... But underline absolutely works, and I can provide a link to an image if you're not convinced, but suffice it to say, I just did it. IIRC italics is the harder thing, as you have to set up X resources for the italics font face to use, or something like that... but it all works. Hardly anyone uses xterm these days though AFAICT, and configuring it properly has become a lost art. In fact, quite a few years ago now, I filed a bug against xterm in some version of Fedora or even Red Hat, and Red Hat's support people closed the ticket, complaining that xterm was obsolete and no longer supported. (!!!) > So why do most HTML->text conversion programs ignore styles and > colors in --dump mode? Is there one that shows styles/colors? This is most of what I want--with the built-in pager (or an alternative built-in pager that you could configure Mutt to use via option). As others have pointed out there's also trouble parsing long URLs and such, depending on the tool you're using to do it. The console browsers all kinda work for this but each has its own idiosyncratic edge-case failures. -- Derek D. Martinhttp://www.pizzashack.org/ GPG Key ID: 0xDFBEAD02 -=-=-=-=- This message is posted from an invalid address. Replying to it will result in undeliverable mail due to spam prevention. Sorry for the inconvenience. signature.asc Description: PGP signature
Re: Rendering HTML as Markdown in mutt (was: Creating HTML emails with mutt)
On Mon, Nov 04, 2019 at 08:01:29PM -0600, Derek Martin wrote: > On Fri, Nov 01, 2019 at 12:21:15PM +1300, martin f krafft wrote: [snip] > > but in addition to viewing HTML messages, I (and others who have > > added to this thread) would like a way to reply without losing the > > formatting. > > > > The viewing side isn't so hot either. Most terminal programs > > these days can display colors, italics, bold, underline and > > strikethrough (looks like urxvt doesn't do strikethrough and xterm > > doesn't do underline, > > Xterm most definitely does underline, though you may need to set a > resource to make it do that. I vaguely recall that some text formats > are rendered using colors or reverse text *by default* but can be made > to do the more correct thing via X resources. I just don't recall > the specifics... But underline absolutely works, and I can provide a > link to an image if you're not convinced, but suffice it to say, I > just did it. IIRC italics is the harder thing, as you have to set up > X resources for the italics font face to use, or something like > that... but it all works. > > Hardly anyone uses xterm these days though AFAICT, and configuring it > properly has become a lost art. In fact, quite a few years ago now, I > filed a bug against xterm in some version of Fedora or even Red Hat, > and Red Hat's support people closed the ticket, complaining that xterm > was obsolete and no longer supported. (!!!) Heh, I learned years ago that my true middle name is either "nobody" or "hardly anyone". I've (recently!) had up to a dozen xterms going at once (on multiple FVWM virtual desktops) shepherding large bundles of updates on a number of servers concurrently, and tend to keep several open in different contexts when developing. Anyway, a good place to read up on xterm might be https://invisible-island.net/xterm/ That version of xterm still gets updates several times a year. xterm is neither obsolete nor unsupported, just unloved by some distro.s. `man xterm` has a long section under RESOURCES which describes all of the many adjustable behaviors. You might begin by looking at 'colorULMode'. Sorry, I have no specific advice -- I got my xterm set up years ago and haven't touched the settings in a long time. -- Mark H. Wood Lead Technology Analyst University Library Indiana University - Purdue University Indianapolis 755 W. Michigan Street Indianapolis, IN 46202 317-274-0749 www.ulib.iupui.edu signature.asc Description: PGP signature
Re: Rendering HTML as Markdown in mutt (was: Creating HTML emails with mutt)
Derek Martin wrote: > Hardly anyone uses xterm these days though AFAICT, and configuring it > properly has become a lost art. In fact, quite a few years ago now, I > filed a bug against xterm in some version of Fedora or even Red Hat, > and Red Hat's support people closed the ticket, complaining that xterm > was obsolete and no longer supported. (!!!) i use it all the time. i don't mind if it never changes again but i'd be annoyed if it ever disappeared. cheers, raf
Re: Rendering HTML as Markdown in mutt (was: Creating HTML emails with mutt)
On Tue, Nov 05, 2019 at 09:31:27AM -0500, Mark H. Wood wrote: > Anyway, a good place to read up on xterm might be > https://invisible-island.net/xterm/ > That version of xterm still gets updates several times a year. xterm > is neither obsolete nor unsupported, just unloved by some distro.s. absolutely. All replacements I have ever tried had some or many issues. And while 25 years ago xterm was considered a true heavyweight among terminal emulators, the lack of "improvement" since that means it is probably the most lightweight choice today. Richard
Re: Rendering HTML as Markdown in mutt (was: Creating HTML emails with mutt)
On Tue, Nov 05, 2019 at 07:30:16PM +0100, Richard Z wrote: > On Tue, Nov 05, 2019 at 09:31:27AM -0500, Mark H. Wood wrote: > > > Anyway, a good place to read up on xterm might be > > https://invisible-island.net/xterm/ > > That version of xterm still gets updates several times a year. xterm > > is neither obsolete nor unsupported, just unloved by some distro.s. > > absolutely. All replacements I have ever tried had some or many issues. This used to be true for me as well, but gnome-terminal eventually became good enough, and had better handling of multiple character sets (not in the technical sense, but rather the sense of where the set of characters came from, e.g. CJK, Latin, etc. since they're all one Unicode character set). > And while 25 years ago xterm was considered a true heavyweight among > terminal emulators, the lack of "improvement" since that means it is > probably the most lightweight choice today. I don't think Thomas (Dickey, maintainer of xterm who also hangs out here) would entirely agree with that characterization. ;-) -- Derek D. Martinhttp://www.pizzashack.org/ GPG Key ID: 0xDFBEAD02 -=-=-=-=- This message is posted from an invalid address. Replying to it will result in undeliverable mail due to spam prevention. Sorry for the inconvenience. signature.asc Description: PGP signature