Copy Syntax Highlight for OS X
Copy Syntax Highlight for OS X is an OS X service which copies the selected text to the clipboard, with proper syntax highlighting for the given language.
The intended primary use case is to Paste the copied syntax highlighted-text into productivity applications such as Word, Keynote, and Photoshop, while keeping the code highlighting intact. Such highlighting can then be used in documents for publication and presentations for more spark, so to speak.
To use the tool, install the the pygments Python package. Then download the Service from this repository and install. On any text in any application, select the text and context-click, and the "Copy Syntax Highlight" menu item will be available. A prompt will appear asking for the language to lex the syntax highlight.
A Dark theme is also available, intended for highlighted code text placed on dark backgrounds.
The Service is separated into two themes: the normal theme (which uses the pygments
default style), and the dark theme (which uses the pygments
monokai style). To change the style used, open the service in Automator and change the corresponding style in the Get Specified Text action.
Max Woolf (@minimaxir)