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
- Always specify the language for proper syntax highlighting
- Use inline code for short snippets within text
- Use code blocks for longer examples
- Include comments to explain complex code
- Format code properly for better readability