Skip to content

Instantly share code, notes, and snippets.

@ajtulloch
Created October 31, 2014 17:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajtulloch/5039102ae7d8e57c61a5 to your computer and use it in GitHub Desktop.
Save ajtulloch/5039102ae7d8e57c61a5 to your computer and use it in GitHub Desktop.
#! /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"
@watsy0007
Copy link

thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment