Last active
April 15, 2020 07:55
-
-
Save mgttlinger/0374faf1dfa26bb8be1710b952e77260 to your computer and use it in GitHub Desktop.
Helper script utilising Pandoc and Emacs' ediff to compare changes in all sorts of text documents
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
#! /usr/bin/env bash | |
for f in "$@" | |
do | |
pandoc --to=markdown "$f" -o "$f.md" | |
done | |
if [ $# -eq 3 ]; | |
then | |
emacs -q --eval "(require 'ediff)" --eval "(ediff-files3 \"$1.md\" \"$2.md\" \"$3.md\")" | |
elif [ $# -eq 2 ]; | |
then | |
emacs -q --eval "(require 'ediff)" --eval "(ediff-files \"$1.md\" \"$2.md\")" | |
fi | |
for f in "$@" | |
do | |
rm -i "$f.md" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment