Skip to content

Instantly share code, notes, and snippets.

@avidseeker
avidseeker / markdown-to-email
Created August 14, 2024 03:40 — forked from rtulke/markdown-to-email
markdown-to-email A simple script to send beautifully formatted emails that you write in Markdown. The email will have an HTML payload and a plain-text alternative, so you'll make everyone happy, including yourself.
#!/usr/bin/env python
'''
Send an multipart email with HTML and plain text alternatives. The message
should be constructed as a plain-text file of the following format:
From: Your Name <your@email.com>
To: Recipient One <recipient@to.com>
Subject: Your subject line
---
@avidseeker
avidseeker / yaml_getval.md
Created August 13, 2024 22:00
Retrieving key from yaml-like line

If it works, it works:

TITLE=$(pandoc -t rst f.md -o /dev/null \
    -L <(echo "function Meta(m) print(pandoc.utils.stringify(m.title)) end")
)

Works for no quotes and no leading spaces: