Skip to content

Instantly share code, notes, and snippets.

@jgraham909
Created March 24, 2023 19:05
Show Gist options
  • Save jgraham909/ea0ba8e115eabc071e9c1b5646b726b6 to your computer and use it in GitHub Desktop.
Save jgraham909/ea0ba8e115eabc071e9c1b5646b726b6 to your computer and use it in GitHub Desktop.
colored diff output to html
# uses diff, diffr, sed, aha
# pre.txt is original file, post.txt is updated file
diff -u pre.txt post.txt | diffr | aha | sed 's/color:gray/color:white/g' | sed 's/<pre>/<pre style="white-space: pre-wrap;">/g' > diff.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment