Skip to content

Instantly share code, notes, and snippets.

@Konfekt
Last active May 9, 2023 19:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Konfekt/09e0eff9db36c4478df7ce983c0e4ad4 to your computer and use it in GitHub Desktop.
Save Konfekt/09e0eff9db36c4478df7ce983c0e4ad4 to your computer and use it in GitHub Desktop.
mutt key binding to compile markdown to HTML
# press M in the mutt compose menu before sending to convert
# the markdown syntax of the e-mail text into an HTML e-mail
macro compose M "<pipe-entry>tee /tmp/message.txt | pandoc --standalone --from markdown --to html --metadata title=Message --output=/tmp/message.html<enter><attach-file>/tmp/message.txt<enter><toggle-disposition><edit-description>Message in TEXT format<enter><edit-type><kill-line>text/plain; charset=utf-8<Enter><first-entry><detach-file><attach-file>/tmp/message.html<enter><toggle-disposition><edit-description>Message in HTML format<enter><edit-type><kill-line>text/html; charset=utf-8<Enter>" "attach HTML message converted from Markdown"
# alternatively, use discount instead of pandoc ...
# macro compose M "<pipe-entry>tee /tmp/message.txt | mkd2html > /tmp/message.html<enter>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment