Skip to main content

Basic Code Blocks

Create a code block using triple backticks:

Syntax Highlighting

Specify the language after the opening backticks for syntax highlighting:

Supported Languages

  • Python
  • JavaScript
  • Java
  • C/C++
  • Ruby
  • PHP
  • SQL
  • HTML/CSS
  • Shell scripts
  • And many more

Inline Code

Use single backticks for inline code:

Best Practices

  1. Always specify the language for proper syntax highlighting
  2. Use inline code for short snippets within text
  3. Use code blocks for longer examples
  4. Include comments to explain complex code
  5. Format code properly for better readability