SaltfishTry for free

How to Add a Code Block to a Document in Linear

·2 min read
In this article

Code blocks help you display code snippets clearly within your Linear documents. Follow these steps to insert a code block and apply syntax highlighting.

Explore more Linear tutorials with interactive Saltfish walkthroughs.

Here's how to add a code block to a document in Linear

  1. Open Document and Position Cursor

    Navigate to the Linear document where you wish to add a code block. Click to place your cursor at the exact location where the code block should appear.

  2. Open the Command Menu

    With your cursor positioned, type a forward slash (/) into the document. This action will open a contextual command menu with various formatting options.

  3. Insert Code Block

    From the command menu that appears, locate and select the 'Code block' option. This will insert an empty code block into your document at the cursor's position.

  4. Add Code Content

    Once the code block is inserted, you can start typing or pasting your code directly into it. The block is designed to format code clearly.

  5. Select Language for Highlighting

    To enable syntax highlighting, click on the 'Plaintext' dropdown menu within the code block. Choose the appropriate programming language from the list.

Your turn to show how it works.

Build a walkthrough of your product with Saltfish, then share it with your customers.

Create a guide with Saltfish

Frequently Asked Questions

You can open the command menu by typing a forward slash (/) anywhere in your document where you want to insert content or apply formatting.