Home » Technology » Google’s making code formatting a breeze in Docs

Share This Post

Technology

Google’s making code formatting a breeze in Docs

Google’s making code formatting a breeze in Docs
/

Certain Workspace users will be getting access to code blocks, which could help them upgrade their documentation.

Google logo

a:hover]:text-black text-gray-13 dark:text-gray-e9 dark:[&>a:hover]:text-gray-e9 [&>a]:shadow-underline-gray-13 [&>a:hover]:shadow-underline-black dark:[&>a]:shadow-underline-gray-63 dark:[&>a:hover]:shadow-underline-gray-63″>Code blocks in Docs.
a:hover]:text-gray-63 text-gray-63 dark:[&>a:hover]:text-gray-bd dark:text-gray-bd dark:[&>a]:text-gray-bd [&>a]:shadow-underline-gray-63 [&>a:hover]:shadow-underline-black dark:[&>a]:shadow-underline-gray dark:[&>a:hover]:shadow-underline-gray”>Illustration: The Verge

Google Docs is getting a new feature that will make it easier to show code in an easy-to-understand way. The company announced that it’s adding code blocks to its “smart canvas” system, which will automatically add the proper spacing and color-coding for a variety of programming languages, such as Python, C, and Javascript.

Before this, getting code to look nice in Google Docs required workarounds or add-ons, which weren’t necessarily the most convenient. While that wasn’t the end of the world, making sure code displays properly is important for documentation, and having different parts of the code display in different colors makes it much easier to read if there’s more than a single line or two.

Gif showing someone formatting a few lines of code using Google Docs’ code blocks.

Gif showing someone formatting a few lines of code using Google Docs’ code blocks.

a:hover]:text-black text-gray-13 dark:text-gray-e9 dark:[&>a:hover]:text-gray-e9 [&>a]:shadow-underline-gray-13 [&>a:hover]:shadow-underline-black dark:[&>a]:shadow-underline-gray-63 dark:[&>a:hover]:shadow-underline-gray-63″>Doesn’t that look so much nicer?
a:hover]:text-gray-63 text-gray-63 dark:[&>a:hover]:text-gray-bd dark:text-gray-bd dark:[&>a]:text-gray-bd [&>a]:shadow-underline-gray-63 [&>a:hover]:shadow-underline-black dark:[&>a]:shadow-underline-gray dark:[&>a:hover]:shadow-underline-gray”>GIF: Google

Google says you’ll be able to access the feature by going to Insert > Building Blocks > Code Block and then selecting the relevant language. You’ll also be able to type “@project assets” into your document to pull up the menu, similar to how you’d summon the emoji picker.

The feature may take a while to roll out — Google’s blog post says some people may not even have it by January 18th, depending on their Workspace’s settings — and it’ll only be available to people with specific subscription tiers. If you’re using a personal Google account, a legacy G Suite account, or various Essential and Starter Workspace tiers, you won’t have access to it, according to the company’s press release. That’s a bit of a bummer for hobbyist coders trying to write instructions for their APIs, though I’ll admit that this feature does seem like it’d be most useful for bigger companies.

Share This Post

Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.