Xit icon indicating copy to clipboard operation
Xit copied to clipboard

Syntax highlighting

Open Uncommon opened this issue 8 years ago • 0 comments

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/

Uncommon avatar Mar 20 '17 15:03 Uncommon