Google Docs has recently become one of the most popular services for working with text documents. In particular, it is caused by the fact that Google Docs has quite a few different functions and tools that make working with text documents straightforward and convenient. However, for a long time, Google Docs was very inconvenient for sharing pieces of programming code. Now there is a handy feature for this.
A recent Google Docs blog says, “Currently when working in Google Docs, employees who want to submit code have to paste it into the document and then manually apply styles by highlighting the syntax. We’re adding a new smart canvas feature that greatly simplifies this process by allowing code to be formatted and displayed in Docs using blocks of code.“
The new feature for code insertion is now available under Insert > Building Blocks > Code Block. Here you’ll be able to choose from currently available programming languages such as Java, Python, C++, and JavaScript. Google Docs will create a block and give you a unique color formatting for your chosen language. You can also type the @ symbol into your document and “code blocks.”
These blocks will be handy for those working on various programming guides and tutorials. Or, for example, various examples and presentations of code projects or anything else in Google Docs where you might need code examples.
Google said the feature would be available in the service within 15 days. However, it won’t be available to personal Google accounts at first. The feature is only supported by Workspace accounts provided by a company or other organization. It is unclear when and if everyone will be able to try this feature.