diff --git a/office/.config/neomutt/keys/bind b/office/.config/neomutt/keys/bind index 21c64cb..29f5712 100644 --- a/office/.config/neomutt/keys/bind +++ b/office/.config/neomutt/keys/bind @@ -187,6 +187,17 @@ bind attach l view-mailcap # macro index x "all\n" "show all messages (undo limit)" # macro index \ci "~F\n" "Limit by flagged" +# Write (djot-flavored) markdown and instantly transform it into a TXT/HTML result +# HTML-enabled email readers display that and others can still enjoy a txt representation +macro compose ,m \ + "set pipe_decode\ + pandoc -f gfm -t plain -o /tmp/msg.txt\ + pandoc -s -f gfm --standalone --embed-resources -o /tmp/msg.html --template email\ + unset pipe_decode\ + /tmp/msg.txt\ + /tmp/msg.html\ + " \ + "Convert markdown to HTML5 and plaintext alternative content types" # # diff --git a/writing/pandoc/local/share/pandoc/templates/email.html b/writing/pandoc/local/share/pandoc/templates/email.html new file mode 100644 index 0000000..8c15480 --- /dev/null +++ b/writing/pandoc/local/share/pandoc/templates/email.html @@ -0,0 +1,25 @@ + + + + + + +$for(css)$ + +$endfor$ + +$for(header-includes)$ + $header-includes$ +$endfor$ + + + $body$ + $for(include-after)$ + $include-after$ + $endfor$ + +