dotfiles/.local/bin/scripts/mdoh

10 lines
287 B
Bash
Executable File

#!/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