Code Blocks

By using code blocks, you can effectively showcase programming concepts, share code with peers, or organize your own code snippets. Moreover, it allows you to effortlessly copy any code to your clipboard for use in other contexts.

How do I add a code block?

By utilizing a code block, you can exhibit code on any Trickle post or item in a distinct format, separate from your other content and categorized by language.

  • Type /Code on the editor. Alternatively, click the + on the editor menu and select Code.
Code block

Code block menu

Once you have created your code block, simply click inside it to begin typing or pasting your code.

Code block menu

The menu at the top of the code block is where you can apply the following:

  1. Language Selector: Open the Language Selector to choose the display language of your code.
language selector
Mermaid example: Input code, get visual result.
  1. Language menu: Search for your programming language by typing its name in the search bar. Syntax highlighting is supported for 194 programming languages.
  2. Light/dark Mode Toggle: Toggle between Light and Dark mode with a click.
Light/dark mode
  1. Remove: Click the trash can icon to clear all the code within the block.

Copy code

After posting the code block, click the "Copy" button on the top right corner to copy your code for sharing or pasting into an editor.

⌨️ Note
Multiple code blocks can be added to a single post or item, and the code you share can be copied by everyone in the workspace.

Start Your Journey to Success!

Start your journey towards success today by taking the first step and signing up for Trickle.