Skip to content

Code Blocks

To add syntax highlighting in code, you just need to wrap it with three backticks, add your code, and then close the backticks. You’re good to go!

```python
print("test code")
a = 10
```

CodeBlock

Add Title In Code Block

Now, if you want a title in code blocks, you just need to add title="some title" and you’re good to go then.

```python title="app.py"
print("test code")
a = 10
```

CodeBlockWithTitle

Highlight Line In Code Block

If you want line highlight, just add the line number in curly brackets {line number}

```python title="app.py" {2}
print("test code")
a = 10
```

CodeBlockWithTitleAndHighlightLine