nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [nmh-workers] Formatting HTML to Text: netrik.


From: Ken Hornstein
Subject: Re: [nmh-workers] Formatting HTML to Text: netrik.
Date: Fri, 28 Jun 2019 10:44:23 -0400

>Apologies if I offended, unintentionally.

Not offended at all; I am more lamenting that we didn't do better.

>>If you are building from source, _if_ you have one of the common
>>text-based HTML browsers available (I use w3m, but we also support lynx
>>and elinks), then show(1) does the right thing, and pretty reasonably I
>>would say.
>
>OK, well, but as noted above, I've screwed things up, badly, so what
>should I *actually* have in my .mh_profile file for the definitions of
>showproc and showmimeproc? what are the current (proper) defaults for
>those?  And do the defaults have options to show me FULL headers for
>each message?  If not, how do I make that happen?

Ok, these things are not hard.

First, delete the entries for showproc and showmimeproc; the defaults
for these programs are fine (they are, respectively, mhl and mhshow; you
can look at mh-profile(5) for the exact defaults).

Secondly, I see that in your profile you have:

        mhshow-show-text/html: more '%F'

Which isn't helping things, so delete that also.  I don't know if the
package for nmh on FreeBSD sets things up correctly, but if you look
at mhn.defaults (which should be in the 'etc' directory somewhere) you
might see a line that looks like:

mhshow-show-text/html: charset=%{charset}; %lw3m -dump ${charset:+-I 
"$charset"} -T text/html %F

If you DON'T, then you could add that to your profile (assuming you are using
w3m) and that should make 'show' mostly do the right thing.

I also see you have:

        mhshow-charset-iso-8859-1: %s

I'd delete that also (we have native support for iconv).  And just as a
matter of future-proofing, I'd recommend using a UTF-8 locale if you aren't
already.

Now, for showing full headers ... this is also not hard, but what you need
to do isn't obvious because things are kinda spread out.  The program by
default that handles message display is mhl, so you could should read
the mhl man page.  Header fields are called 'components' in MH-speak,
so normally you need to list all of the components you want displayed
(or ignored).  But if you want them all:

       The component "Extras" will output all of the components of the message
       which were not matched by  explicit  components,  or  included  in  the
       ignore list.  If this component is not specified, an ignore list is not
       needed since all non-specified components will be ignored.

So just list the ones in the mhl form file you want first then use "extras"
to display the rest.  In fact ... it looks like this is actually the default
mhl format?  So maybe the defaults do what you want already?  Well, except
that maybe you want to delete the "ignores" line.

But here's where things are "fun".  For historical reasons, show/mhl don't
handle MIME messages; that gets passed off to mhshow.  This was fine back
20-30 years ago, but nowadays most messages are MIME messags.  What happens
with a MIME message is mhshow uses mhl to display the headers and then
handles the body of the message on it's own.  So to get full headers for
MIME messages you need to modify the mhl format used by mhshow to
display the headers; the default one is mhl.headers, and I believe that
again what you need to do is simply delete the 'ignores' line.  What
I do is copy the ones provided by nmh to my local 'Mail' directory and
modify them appropriately; that way I don't need to modify my profile.

So, I believe that will do what you want with regards to message display.
If that does not work, please let us know.

>(I'm just real glad that you folks did your's in Perl, cuz that happens
>to be one of the few languages that I actually speak somewhat. It would
>all have been utterly Greek to me if it was in Python or Ruby or Go or
>something.)

I hear you; maybe we're both old enough to remember when Perl was the
hot new language, and now we sound like grumpy old men.  "Kids these
days, inventing all of these new languages!".

>>  See the comments at the top of replyfilter for usage information; it
>>  will likely require some adjustment for your site.
>
>I don't follow.  What will need adjusting, exactly?

Well, I could improve the documentation there as well.  Specifically
you might need to change $filterprogram, $outcharset, and @htmlconv.
You asked about 'par'; you can download it here:

        http://www.nicemice.net/par/

I was under the vague impression that there is a package for FreeBSD
for it.  But you don't HAVE to use it; 'fmt' would probably be an
acceptable substitute.

>>I thought we did a pretty good job of putting this information out
>>there, but clearly in the 7 years since 1.5 has come out everyone
>>hasn't gotten the word yet.
>
>Um.... I don't suppose it will help my case any of I were to say
>something like "I was busy, and had a LOT of stuff to do", would it?
>(But that's actually true, and I hope that I've done some Good Things
>for the Internet and for humanity in that time.)

I mean, that's a fine answer, and I get that.  We just had a number of
people who have said since the 7 (!) years since we released 1.5, "Hey,
did you guys ever come up with any solution to dealing with MIME message
replies?" and I'm like, "Um, YES!".  So I want to understand where we
failed.  "I was busy, I had something which sorta-worked and I didn't
have time to fix it" is a fine answer.  I'd like to figure out how
to make THAT better, but I am busy as well.  Sigh.

So, anyway, I think we have the tools to make things much better for you.
Hopefully in the future it will all be mostly-automatic.  If you run into
problems, please let us know here.

--Ken



reply via email to

[Prev in Thread] Current Thread [Next in Thread]