Last active
May 15, 2017 09:13
-
-
Save madeindjs/0ca618a63f03ea8c6ce4c3db181fec78 to your computer and use it in GitHub Desktop.
A simple markdown converted to Wiki formating using SED
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat "$1" | | |
# code block tags | |
sed -E 's/(~~~|```)([a-z]+)/<pre><code class="\2">/g' | | |
sed -E 's|(~~~\|```)|</pre></code>|g' | | |
# inline code tag | |
sed -E 's/`(.*)`/@\1@/g' | | |
# italic tag | |
sed -E 's/\*/_/g' | | |
# bold tag | |
sed -E 's/__/\*/g' | | |
# replace title tag | |
sed -E 's/#+ (.*)/\+\*\1\*\+/g' | | |
# list | |
sed -E 's/_ /\* /g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment