text: Title: Apply code formatting to code examples in our docs
  Body: Currently our code examples are not formatted using `black` or linted in any way.
  * Investigate what mkdocs extensions there are to do this and what they would do (e.g. they might run `ruff` or `black`)
  * Find a good solution and apply it!