I use Google Docs to make my programming notes. For which I have to write some code examples. As you know that writing code requires the syntax to be highlighted. But unfortunately, Google Docs lacks this feature. So I tried to search for an appropriate solution to highlight my code examples. And I have come across a solution which I am going to share with you. I know that this solution is not perfect, but it works for me :-)
Step 1: Open www.Snipt.net and Sign Up for new account.
Step 2: After signing in click on the Add Snipt button.
| Click on Add Snipt |
Step 3: Write your code in given area, select appropriate language from dropdown and click save button.
| Adding code on Snipt.net |
Step 4: You can see in below image that your code is colourized. Select this colourized code and copy it.
| Syntax Highlighting on Snipt.net |
Step 5: Paste this code into Google Docs (Google Documents or Google Presentation). Here is the result.
| Syntax Highlighting on Google Documents with white background page. |
Note:
- If you are feeling difficulty in reading code on Google Docs then make it bold.
- Be sure that background of Google Documents or Google Presentation is white. Otherwise the result will be like this...
| Syntax Highlighting on Google Presentation with blue background slide. |

Thank You for sharing your knowledge.
ReplyDeleteCool workaround. Thanks!
ReplyDeleteFirst time I've heard about SnipIt! I signed up and tried it out for some JS snippets from CodeAcademy. While entering code, it's very colorful, but once published to the web, the vibrant color scheme disappears. It's output looks identical to that of Github Gists. But at least users have a choice between the two services.
ReplyDeletehttps://gist.github.com
-Jun
This will make your code colored, but it won't continue colorizing as you write. If you're just going to paste it to a presentation anyway, might it just be easier to take a screenshot from Notepad++ or similar?
ReplyDeleteYou can do this same trick with pastebin.com, except there you don't need to create a login first!
ReplyDelete(this is much better than making a screenshot, because you can still easily change the font, and scaling the text also works.)
Code Pretty add-on for Google Docs does just that.
ReplyDelete