-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Html render with w3m #789
Comments
Salut! =) This is a problem I'm still wondering how to solve. For now I have two ways to view HTML:
I tried many HTML to text renders, but none seems a good option. w3m is good at keeping text formatting, but sometimes it hides links. And that can be very bad. E.g.:
And I would reply:
This happened a few times to me, so I started using Pandoc ( The second path, piping to a browser, is good when you open a message an you realize it's not displaying right. The problem is when you don't realize that, like in the problem described above. But it would be great to have better console display of messages: bold, italic, colors. |
Did any of you try elinks? I am using elinks and did not yet have any problems besides bad formatting (aliment, colors, bold, underline etc) but until now I attributed this to the terminal not being a good place to render html in general :) . From my .mailcap:
I have no technical insight on this but I assume that it is not possible to get w3m to display the images if you |
@andresmrm Originaly I was searching a way of displaying images (as in w3m) in alot, but didn't find a way, I think there could be a way using the framebuffer and python. @lucc |
@lucc But I try to display a webpage with both w3m and elinks, and it work well with w3m, but I did not get any form of format with elinks, and no image at all, did you manage to display image with elinks ? |
No I did not get images and I also think it is not possible via mimecap file entries (see speculation above). As far as I understand mailcap the only entry that is relevant for email readers (and other programs that use mailcap to get a rendered version of some data to display themselves) is the |
Thanks for the tip, Lucas. I had used elinks before and changed for a reason |
Hi everyone, |
Hi, @guillaumecherel! I pipe it to a script. =)
|
Hey some life on this issue ! @lucc Sorry for the big delay but I didn't see your reply, I still not find a way of doing text/html rendering in w3m and pull it back into alot, but emacs seems to be able to change its default internal renderer to w3m (I didn't try it), so it could be a way. |
@guillaumecherel about sending only the html part: I started a PR to add a mime tree view to alot it might be useful for this use case. The mime tree view in mutt that is serving as my example can be used to pipe a single mime part to an external command. The PR is here: #894 (sadly I have little time to work on this right now, hopfuly later in December) |
@lucc I saw that, and indeed I think it'd be perfect for this use case! |
I implemented a little script to open HTML and other multimedia types on macOS: https://github.com/earksiinni/pipe-mime-to-qlmanage. Instructions are available at the link. I use this script to read HTML emails in Safari on my Mac while using alot on my remote text-only computer, thanks to SSH forwarding. |
cute. Thanks for sharing @earksiinni ! |
The most notable use case is piping html to a browser without extra scripts such as those shared in pazz#789.
The most notable use case is piping html to a browser without extra scripts such as those shared in pazz#789.
The most notable use case is piping html to a browser without extra scripts such as those shared in pazz#789.
Many browsers (including chromium) require that files end in the '.html' extension in order to render them. See <https://bugs.chromium.org/p/chromium/issues/detail?id=777737>. When using `pipeto --format=mimepart --as_file`, on an html mime part, let's automatically set the file extension. This eliminates the need for additional user scripts referenced in issues such as pazz#789 and pazz#1153.
Many browsers (including chromium) require that files end in the '.html' extension in order to render them. See <https://bugs.chromium.org/p/chromium/issues/detail?id=777737>. When using `pipeto --format=mimepart --as_file`, on an html mime part, let's automatically set the file extension. This eliminates the need for additional user scripts referenced in issues such as pazz#789 and pazz#1153.
Many browsers (including chromium) require that files end in the '.html' extension in order to render them. See <https://bugs.chromium.org/p/chromium/issues/detail?id=777737>. When using `pipeto --format=mimepart --as_file`, on an html mime part, let's automatically set the file extension. This eliminates the need for additional user scripts referenced in issues such as pazz#789 and pazz#1153.
Many browsers (including chromium) require that files end in the '.html' extension in order to render them. See <https://bugs.chromium.org/p/chromium/issues/detail?id=777737>. When using `pipeto --format=mimepart --as_file`, on an html mime part, let's automatically set the file extension. This eliminates the need for additional user scripts referenced in issues such as pazz#789 and pazz#1153.
I'd like to note that the "link hiding" issue can be fixed by implementing terminal hyperlinks in a terminal web browser. @lypanov has a solution that works fairly well, but it's limited by the fact that terminal web browsers currently clobber the information about what is the anchor text for a link. See tats/w3m#116. |
The most notable use case is piping html to a browser without extra scripts such as those shared in pazz#789.
Many browsers (including chromium) require that files end in the '.html' extension in order to render them. See <https://bugs.chromium.org/p/chromium/issues/detail?id=777737>. When using `pipeto --format=mimepart --as_file`, on an html mime part, let's automatically set the file extension. This eliminates the need for additional user scripts referenced in issues such as pazz#789 and pazz#1153.
The most notable use case is piping html to a browser without extra scripts such as those shared in pazz#789.
Many browsers (including chromium) require that files end in the '.html' extension in order to render them. See <https://bugs.chromium.org/p/chromium/issues/detail?id=777737>. When using `pipeto --format=mimepart --as_file`, on an html mime part, let's automatically set the file extension. This eliminates the need for additional user scripts referenced in issues such as pazz#789 and pazz#1153.
The most notable use case is piping html to a browser without extra scripts such as those shared in pazz#789.
The most notable use case is piping html to a browser without extra scripts such as those shared in pazz#789.
Many browsers (including chromium) require that files end in the '.html' extension in order to render them. See <https://bugs.chromium.org/p/chromium/issues/detail?id=777737>. When using `pipeto --format=mimepart --as_file`, on an html mime part, let's automatically set the file extension. This eliminates the need for additional user scripts referenced in issues such as pazz#789 and pazz#1153.
The most notable use case is piping html to a browser without extra scripts such as those shared in pazz#789.
The most notable use case is piping html to a browser without extra scripts such as those shared in pazz#789.
Many browsers (including chromium) require that files end in the '.html' extension in order to render them. See <https://bugs.chromium.org/p/chromium/issues/detail?id=777737>. When using `pipeto --format=mimepart --as_file`, on an html mime part, let's automatically set the file extension. This eliminates the need for additional user scripts referenced in issues such as pazz#789 and pazz#1153.
great stuff! this script solved my problem with HTML mails. I only modified it slightly to add the
|
The most notable use case is piping html to a browser without extra scripts such as those shared in pazz#789.
Many browsers (including chromium) require that files end in the '.html' extension in order to render them. See <https://bugs.chromium.org/p/chromium/issues/detail?id=777737>. When using `pipeto --format=mimepart --as_file`, on an html mime part, let's automatically set the file extension. This eliminates the need for additional user scripts referenced in issues such as pazz#789 and pazz#1153.
The most notable use case is piping html to a browser without extra scripts such as those shared in pazz#789.
The most notable use case is piping html to a browser without extra scripts such as those shared in pazz#789.
Many browsers (including chromium) require that files end in the '.html' extension in order to render them. See <https://bugs.chromium.org/p/chromium/issues/detail?id=777737>. When using `pipeto --format=mimepart --as_file`, on an html mime part, let's automatically set the file extension. This eliminates the need for additional user scripts referenced in issues such as pazz#789 and pazz#1153.
Many browsers (including chromium) require that files end in the '.html' extension in order to render them. See <https://bugs.chromium.org/p/chromium/issues/detail?id=777737>. When using `pipeto --format=mimepart --as_file`, on an html mime part, let's automatically set the file extension. This eliminates the need for additional user scripts referenced in issues such as pazz#789 and pazz#1153.
I somehow missed this mention sorry. My work around for this issue is to manually parse the References output from elinks and embed it back into the output. Working for pretty much every email I've recieved since 2020 ;) The script in question: I'll try to get my latest patch set working against current alot sometime this year. |
I'll try to look into this shortly as I'd like to get my alot fork on python 3.13 to benefit from some of the speed ups. |
Hello there,
I am a new user of alot, and already a big fan !
I search to display a bit better, some of the html mail that I may get (some people/company),
didn't like plain text :( so I need a descent display for html and images.
I use is w3m because it can also render image in my terminal (rxvt),
but when I read a mail in alot my html render is very simple, just the text is displayed with no color or images.
Here what I used in ~/.mailcap file:
text/html; w3m -dump -o document_charset=%{charset} '%s'; nametemplate=%s.html; copiousoutput
Maybe w3m is not the better in alot, did someone manage to get it to work ?
The text was updated successfully, but these errors were encountered: