Syntax Highlighting
Syntax highlighting in code blocks is done using the codehilite and fenced_code extensions. You can create code blocks (language name can be deduced):
- With a shebang (to show line numbers)
1 2 |
|
- With three backticks (uses attr_list)
```python
print("Hello World!")
```
If you want to highlight lines, you can use the hl_lines
option:
- With three backticks (uses attr_list)
``` { .python hl_lines="1 3" }
print("Hello", end=" ")
print("World", end="")
print("!")
```
- With a shebang (to show line numbers)
1 2 3 4 |
|