> ## Documentation index
> Fetch the complete documentation index at: https://workover.io/docs/llms.txt

# How to insert a code block

Insert a code block in a Workover document from the / menu, toolbar or a shortcut, set its language, add inline code, and bring code in from Google Docs.

A code block shows code in a monospace font with syntax highlighting. You can insert one from the `/` menu, the toolbar, or by typing.

**Before you start:** you need the editor or owner role on the document.

## Insert a code block

Use any of these:

![The toolbar with the Code block button highlighted](https://api.workover.io/public/sites/4/media/eyJidWNrZXQiOiJkb2NzIiwia2V5IjoiZG9jLW1lZGlhL3NoYXJlZC9hYTFmMmU4ZGUwNjg0M2UzNzBlMWZmZDcwYjIxNzI3YWNjOGIyYTM1LnBuZyIsInNjb3BlIjoic2hhcmVkIn0.Y2KpMRQGs3c2OrjfgZ4UlurSoiokwqz8aoeE5kJqP74)

- Type `/code` and select **Code block**.
- Select **Code block** in the toolbar.
- Type \`\`\`\`\` at the start of an empty line, then a space.
- Press `⌘⌥C` (**Ctrl+Alt+C** on Windows and Linux).

Then type or paste your code inside the block.

## Set the language

There is no language picker. To set a language, type it straight after the backticks when you create the block, for example `js` or`python\`, then a space. Without a language, Workover detects one automatically for highlighting.

Fenced code pasted as Markdown, such as a block starting with \`\`\`\`js\`, also keeps its language. See [Pasting Markdown](https://workover.io/docs/editor/markdown-paste).

## Inline code

For code inside a sentence, wrap it in single backticks, such as `npm install`, or select the text and press `⌘E`.

## From Google Docs

Text set in a monospace font in Google Docs, and Google Docs code blocks, become code automatically when you paste them into Workover. See [Importing from Google Docs](https://workover.io/docs/integrations/import-markdown).

If code still does not come through as a code block, you can mark it with tags in the Google Doc before you bring it into Workover. Put `[code]` alone on the line before the code and `[/code]` alone on the line after it.

![Google Doc with the code and /code tags on their own lines around a line of code](https://api.workover.io/public/sites/4/media/eyJidWNrZXQiOiJkb2NzIiwia2V5IjoiZG9jLW1lZGlhL3NoYXJlZC9hMmM2OWUxMDE1NmYyNmQxMjMxYmVlN2U2ZDNiOGM1MWM3NWQ1Y2U2LnBuZyIsInNjb3BlIjoic2hhcmVkIn0.49ype1oG_2thAirxnnDGIeDMoVut8jFtxIeE6CEQVkc)

The tags stay visible as plain text in the Workover editor. They are turned into a WordPress code block only when you push the document, and only when each tag is on its own line.

## Related

- [Keyboard shortcuts and slash commands](https://workover.io/docs/editor/keyboard-shortcuts)
- [Pasting Markdown](https://workover.io/docs/editor/markdown-paste)
- [Importing from Google Docs](https://workover.io/docs/integrations/import-markdown)
- [How to push a document to WordPress](https://workover.io/docs/wordpress/push)
