Canvas: Introduction of code blocks in Create with compatibility for various code-languages and content mapping into Sanity Studio

✨ Highlights

Create now has support for code blocks

You can now create code blocks in Create. There are multiple methods for creating a code block that should feel familiar from other writing environments.

Use /code to create a text code block. You can manually set the type, or let Create auto-detect the type after you begin writing code.

Use the ``` syntax to create a block. Enter the three backticks and press enter to start the block. You can also use the markdown language syntax to set the language. For example, ```ts.

Paste code directly into Create and it will attempt to recognize code, create a block, and if possible auto-detect the language.

Ghostwriting and instructions can also interact with code blocks as well. Ghostwriting will notice prompts and, if it makes sense to do so, output a code block based on the instructions.

As with other content types, code blocks can be content mapped into Sanity Studio types.