Code Blocks

Markdown Renderer for Confluence supports syntax-highlighted code blocks for multiple programming languages, making your technical documentation more readable and professional.

Basic Code Blocks

Create a code block using triple backticks:

```python
def hello_world():
    print("Hello, World!")
```

Syntax Highlighting

Specify the language after the opening backticks for syntax highlighting:

```javascript
function calculateSum(a, b) {
    return a + b;
}
```

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:

Use the `print()` function to output text

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