Skip to content

Commit

Permalink
Try code-block captions for #973
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Mar 6, 2023
1 parent 0b4054d commit 0192ebd
Showing 1 changed file with 16 additions and 24 deletions.
40 changes: 16 additions & 24 deletions docs/engine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ Playing

Example: Let Stockfish play against itself, 100 milliseconds per move.

.. code:: python
"""Using synchronous engine.SimpleEngine."""
.. code-block:: python
:caption: Using synchronous :class:`~chess.engine.SimpleEngine`
import chess
import chess.engine
Expand All @@ -42,9 +41,8 @@ Example: Let Stockfish play against itself, 100 milliseconds per move.
engine.quit()
.. code:: python
"""Using async engine."""
.. code-block:: python
:caption: Using asyncio
import asyncio
import chess
Expand Down Expand Up @@ -77,9 +75,8 @@ Analysing and evaluating a position

Example:

.. code:: python
"""Using synchronous engine.SimpleEngine."""
.. code-block:: python
:caption: Using synchronous :class:`~chess.engine.SimpleEngine`
import chess
import chess.engine
Expand All @@ -98,9 +95,8 @@ Example:
engine.quit()
.. code:: python
"""Using async engine."""
.. code-block:: python
:caption: Using asyncio
import asyncio
import chess
Expand Down Expand Up @@ -146,9 +142,8 @@ Indefinite or infinite analysis

Example: Stream information from the engine and stop on an arbitrary condition.

.. code:: python
"""Using synchronous engine.SimpleEngine."""
.. code-block:: python
:caption: Using synchronous :class:`~chess.engine.SimpleEngine`
import chess
import chess.engine
Expand All @@ -165,9 +160,8 @@ Example: Stream information from the engine and stop on an arbitrary condition.
engine.quit()
.. code:: python
"""Using async engine."""
.. code-block:: python
:caption: Using asyncio
import asyncio
import chess
Expand Down Expand Up @@ -206,9 +200,8 @@ Options
:func:`~chess.Protocol.analyse()` and
:func:`~chess.Protocol.analysis()` accept a dictionary of options.

.. code:: python
"""Using synchronous engine.SimpleEngine."""
.. code-block:: python
:caption: Using synchronous :class:`~chess.engine.SimpleEngine`
import chess.engine
Expand All @@ -223,9 +216,8 @@ Options
# [...]
.. code:: python
"""Using async engine."""
.. code-block:: python
:caption: Using asyncio
import asyncio
import chess.engine
Expand Down

0 comments on commit 0192ebd

Please sign in to comment.