Created
October 31, 2014 17:56
-
-
Save ajtulloch/5039102ae7d8e57c61a5 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# A hacky script that converts org-mode documents to an old-style | |
# Remarkup dialect, used by Phabricator and other tools. | |
set -x | |
set -e | |
pandoc --read=org --write=markdown --atx-headers $1 \ | |
| sed -E "s/\{\.(.*)\}/lang=\1/g" \ | |
| sed -E "s/\[(.*)\]\((.*)\)/[[\2 | \1]]/g" \ | |
| sed "s/^####\s/====\s/g" \ | |
| sed "s/^###\s/===\s/g" \ | |
| sed "s/^##\s/==\s/g" \ | |
| sed "s/^#\s/=\s/g" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thx