Syntax highlighting
To use syntax highlighting you need to enable the following extensions in your mkdocs.yml
:
You can wrap inline code between backticks (`
) to apply syntax highlighting. Example: `#!python print('Hello world')`
will be rendered as print('Hello world')
.
You can also use Fenced Code Blocks, i.e., wrap multiline code between triple backticks (```
). Example:
You can also add line numbers: