Skip to content

Instantly share code, notes, and snippets.

@mgttlinger
Last active April 15, 2020 07:55
Show Gist options
  • Save mgttlinger/0374faf1dfa26bb8be1710b952e77260 to your computer and use it in GitHub Desktop.
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
#! /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