dotfiles/.local/bin/mdoh

11 lines
288 B
Plaintext
Raw Normal View History

#!/bin/sh
# Transforms org to markdown using a simplified regex
sed ':o; s/_\(\w[^_]*\w\)_/\/\1\//g;
/^#\+ /{
s/^#/*/; To;
:b; s/^\(\**\)#/\1*/g; tb;
n; s/^$//; To; D
}' "$@"
# echo "# one\n\n# two\n## under #two\n_hello under_two_\nnumber #1" | mdoh