diff --git a/sphinx/literalinclude-with-markers.md b/sphinx/literalinclude-with-markers.md index dcbd81f488..6d8e1ae8a8 100644 --- a/sphinx/literalinclude-with-markers.md +++ b/sphinx/literalinclude-with-markers.md @@ -31,6 +31,8 @@ Note that the paths like `../tests/test_docs.py` are relative to the root `docs/ Then in [tests/test_docs.py](https://github.com/simonw/datasette/blob/0f63cb83ed31753a9bd9ec5cc71de16906767337/tests/test_docs.py#L109-L141): ```python +# fmt: off + # -- start test_homepage -- @pytest.mark.asyncio async def test_homepage(): @@ -58,3 +60,5 @@ async def test_signed_cookie_actor(): # -- end test_signed_cookie_actor -- ``` The rendered documentation [can be seen here](https://docs.datasette.io/en/latest/testing_plugins.html#using-datasette-client-in-tests). + +The `# fmt: off` line at the start is an instruction to [Black](https://github.com/psf/black) to ignore that section of the file. Without that, running Black would insist on adding newlines before the closing `# -- end` comments, which would show up [as blank space in the documents](https://github.com/simonw/datasette/issues/2231).