How to Highlight Code Snippets in Google Docs

zcov How to Highlight Code Snippets in Google Docs

One of the few things you need to keep in mind while writing a good programming tutorial or documentation is to provide code snippets.

Including code snippets in your documentation is usually a good idea. This will explain to your readers what you are doing and trying to accomplish with that particular piece of code.

So if you want to share snippets of that code and you want it to look good, not just raw text, you can make this happen by using a certain Google Docs extension.

1. Open Google Docs, and install an extension called Code Blocks. You can find the tutorial on how to install an extension in our previous tutorial.

z1 How to Highlight Code Snippets in Google Docs

2. In the document, type the code that you want to convert into Code Block and then highlight it.

z2 How to Highlight Code Snippets in Google Docs

3. Go to the Extensions menu, Code Blocks, and then start.

z3 How to Highlight Code Snippets in Google Docs

4. The extension will show on the right-hand side. This is where you can choose the programming language. There are a ton of languages here. In our example, the code is in Python.

z4 How to Highlight Code Snippets in Google Docs

5. You can also choose a theme to make it more attractive.

z5 How to Highlight Code Snippets in Google Docs

6. You can preview it first, and then once you’re ready to convert it, click on Format.

z6 How to Highlight Code Snippets in Google Docs

7. Once you’re satisfied with what your code block looks like, close the Code Blocks extension.

z7 How to Highlight Code Snippets in Google Docs

So that’s how to keep your code snippets organized in coding notes.

About The Author