Code Blocks

Code blocks in NocoDocs support syntax highlighting for 30+ programming languages. Use them to document code snippets, configurations, and technical content.

Code

Insert a Code Block

Use one of these methods:

  • In the editor, type /code. Then select Code Block.
  • Type ```, then press Enter.

Select a Language

  1. At the top-left of the code block, click the language selector.
  2. Search for a language, or select one from the list.

Supported Languages

Some frequently used languages are:

CategoryLanguages
WebJavaScript, TypeScript, HTML, CSS, JSON
BackendPython, Java, Go, Rust, C, C++, C#, Ruby, PHP
ShellBash, Shell, PowerShell
DataSQL, YAML, TOML, XML
OtherMarkdown, Dockerfile, GraphQL, Kotlin, Swift, Dart

Features

FeatureWhat it does
Copy ButtonClick the copy icon at the top-right of the code block. The contents go to the clipboard.
Tab IndentationIn code blocks, Tab adds indentation. It does not move to the next element.
Syntax HighlightingColors update automatically for the selected language.

Mermaid Diagrams

When you select Mermaid as the language, the code block shows a rendered diagram, not the highlighted source. For details, refer to Mermaid Diagrams.

Last updated on

Latest product updates?See Changelog
Stay in the loop? Follow us onLinkedInLinkedInYouTubeYouTubeXX