├── Copy Syntax Highlight Dark.zip ├── Copy Syntax Highlight.zip ├── LICENSE ├── README.md └── img ├── deep4me.png ├── hello-world.gif ├── syntax_highlight.gif └── theme.png /Copy Syntax Highlight Dark.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/copy-syntax-highlight-osx/c691e13af3c24b21490521c13d83802306334404/Copy Syntax Highlight Dark.zip -------------------------------------------------------------------------------- /Copy Syntax Highlight.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/copy-syntax-highlight-osx/c691e13af3c24b21490521c13d83802306334404/Copy Syntax Highlight.zip -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Max Woolf 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Copy Syntax Highlight for OS X 2 | 3 | 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. 4 | 5 | ![](/img/syntax_highlight.gif) 6 | 7 | ## Usage 8 | 9 | The intended primary use case is to Paste the copied syntax highlighted-text into productivity applications such as [Word](https://products.office.com/en-us/word), [Keynote](http://www.apple.com/mac/keynote/), and [Photoshop](http://www.photoshop.com), while keeping the code highlighting intact. Such highlighting can then be used in documents for publication and presentations for more spark, so to speak. 10 | 11 | ![](/img/hello-world.gif) 12 | 13 | To use the tool, install the the [pygments](http://pygments.org) Python package. Then [download the Service](https://github.com/minimaxir/copy-syntax-highlight-osx/blob/master/Copy%20Syntax%20Highlight.zip) 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. 14 | 15 | A [Dark theme](https://github.com/minimaxir/copy-syntax-highlight-osx/blob/master/Copy%20Syntax%20Highlight%20Dark.zip) is also available, intended for highlighted code text placed on dark backgrounds. 16 | 17 | ![](/img/deep4me.png) 18 | 19 | ## Theming 20 | 21 | 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. 22 | 23 | ![](/img/theme.png) 24 | 25 | ## Author/Maintainer 26 | 27 | Max Woolf ([@minimaxir](http://minimaxir.com)) 28 | 29 | ## Credits 30 | 31 | Idea was inspired by comments on [this GitHub Gist](https://gist.github.com/jimbojsb/1630790), which linked to [this Stack Overflow](http://apple.stackexchange.com/questions/94222/how-to-get-automator-to-treat-text-as-rtf/94246#94246) answer which serves as the core function. 32 | 33 | Example GIF uses code sourced from [learnpython.org](http://www.learnpython.org/en/Hello,_World!). The GIFs in this README are rendered using the [Video to GIF OS X tool](https://github.com/minimaxir/video-to-gif-osx). 34 | 35 | ## License 36 | 37 | MIT -------------------------------------------------------------------------------- /img/deep4me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/copy-syntax-highlight-osx/c691e13af3c24b21490521c13d83802306334404/img/deep4me.png -------------------------------------------------------------------------------- /img/hello-world.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/copy-syntax-highlight-osx/c691e13af3c24b21490521c13d83802306334404/img/hello-world.gif -------------------------------------------------------------------------------- /img/syntax_highlight.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/copy-syntax-highlight-osx/c691e13af3c24b21490521c13d83802306334404/img/syntax_highlight.gif -------------------------------------------------------------------------------- /img/theme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/copy-syntax-highlight-osx/c691e13af3c24b21490521c13d83802306334404/img/theme.png --------------------------------------------------------------------------------