From c948694716079be15688d937139961472d417118 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Thu, 26 Sep 2019 00:22:55 -0400 Subject: [PATCH] mutt: add macro for pandoc HTML email generation Using neomutt's multipart/alternative grouping mechanism, we can generate an HTML email (with a custom stylesheet!) and then group it with the markdown plaintext used to generate it. This is a nice compromise between those who like to view the HTML and those who prefer plaintext. One open question is whether this holds up well in terms of preserving the HTML of the thread. Only time will tell! NOTE: requires neomutt . As of now, no multipart/alternative support for mutt. --- mutt/header.html | 7 +++++++ mutt/muttrc | 8 ++++++++ 2 files changed, 15 insertions(+) create mode 100644 mutt/header.html diff --git a/mutt/header.html b/mutt/header.html new file mode 100644 index 0000000..17a94b0 --- /dev/null +++ b/mutt/header.html @@ -0,0 +1,7 @@ + diff --git a/mutt/muttrc b/mutt/muttrc index e19075a..8d2130a 100644 --- a/mutt/muttrc +++ b/mutt/muttrc @@ -34,6 +34,12 @@ set query_command="abook --mutt-query '%s'" # Show some index in the pager set pager_index_lines=10 +# Enables shelling out in macros without a pause +set wait_key=no + +# For pandoc, we need an extra line before the block quotes +set attribution="On %d, %n wrote:\n" + ################################################################################ # Bindings # I've chosen to customize-as-I-go on these. Some general guiding rules: @@ -71,3 +77,5 @@ bind editor complete-query # Used for contact-completion # Macros macro index,pager ga "abook --add-email-quiet" "Add sender to abook contacts" + +macro compose K "|pandoc -s -H ~/.config/mutt/header.html -o /tmp/mutt-alt.html/tmp/mutt-alt.html" -- libgit2 0.28.4