Xit
Xit copied to clipboard
Syntax highlighting
Use syntax highlighting to show source files in diff and text previews.
Stack Overflow uses Google prettify, which is in JavaScript. It's apparently designed to work with blocks of preformatted text. https://github.com/google/code-prettify
GitHub uses Linguist, which is in Ruby. It's probably easier to use line-by-line, such as with diffs, since GitHub displays diffs. https://github.com/github/linguist.
Article on embedding Ruby: http://www.ioncannon.net/programming/1524/embed-ruby-in-your-ios-apps-using-mruby/