Visualising contents of a Maildir
Sam Kuper
sampablokuper at posteo.net
Thu Aug 18 09:45:04 UTC 2022
On Thu, Aug 18, 2022 at 10:10:38AM +0200, martin f krafft via Mutt-users wrote:
> The reason I need this index is that I have to provide evidence of "a
> huge volume of mails" on a given topic, without actually sharing the
> emails.
OK, but...
> So I need a PDF index.
That is a non-sequitur.
In another branch of this thread, I proposed several ways to provide the
evidence you need, without sharing the emails AND without creating PDFs.
So, unless achieving a PDF is a *requirement* (in which case it might
have been helpful to mention that in the first place!), generating a PDF
just seems to be an unnecessary headache.
> Hence I thought making an HTML table, and then printing that. Easiest.
Maybe.
Or you could use a lightweight markup language (lighter than HTML) that
has tables, and a relevant PDF generator for that markup language.
If you like that idea, here's a handy table showing which lightweight
markup languages have tables:
https://en.wikipedia.org/w/index.php?title=Lightweight_markup_language&oldid=1104650806#Comparison_of_language_features
and here's another useful table showing which lightweight markup
languages also offer PDF output:
https://en.wikipedia.org/w/index.php?title=Lightweight_markup_language&oldid=1104650806#Comparison_of_implementation_features
> A screenshot/bitmap approach would be very hard to turn into a useable
> PDF, I think.
Depends what you mean by "usable". If all you need is e.g. an image per
PDF page, several tools can trivially achieve that (e.g. `img2pdf`).
Some tools can also compress the images for you, or you can pipe the
images via compression tools before assembling the PDF, to avoid
creating a humungous PDF.
> Sam is right, threads are digraphs, but Mutt displays them in a table,
> and I think that's a good compromise.
Fair point, if you're also going to capture the ASCII art that indicates
the thread structure.
>> I don't think it will be better or easier than what you've done.
>> But you could try using a '|' filter in $index_format to append some
>> output to a file as a side effect. It would still entail manually
>> pgdn'ing through the index.
>
> Not a bad idea, but unfortunately, the Unicode characters used to
> represent threads in mutt's index seem to be some sort of
> ncurses-special, and the whole thing would need parsing. But this is
> definitely an interesting approach, as I could probably craft an
> `$index_format` that generates HTML `<tr>`'s, and PgDn'ing over a
> thousand messages might be something the X repeat buffer can do. ;)
If you find a lightweight markup language that has PDF output AND has
table markup tags that correspond one-to-one with the '|' filter's
ncurses strings, then you could use the `|` filter as Kevin proposes
above, and pipe the output through sed to replace the ncurses strings
with lightweight markup language strings.
If you really need PDF output, then this may well be the best approach.
All best,
Sam
More information about the Mutt-users
mailing list