From 12c030df6557b3919ba3fcff7f421ccd7ae4f24e Mon Sep 17 00:00:00 2001 From: Vincent Poulailleau Date: Fri, 8 Sep 2023 14:40:28 +0200 Subject: [PATCH] add syntax highlighting to examples in README --- README.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 5587201..39cb60a 100644 --- a/README.rst +++ b/README.rst @@ -59,7 +59,7 @@ Example usage The ``decode`` function accepts instances of ``PIL.Image``. -:: +.. code-block:: python >>> from pyzbar.pyzbar import decode >>> from PIL import Image @@ -90,7 +90,7 @@ The ``decode`` function accepts instances of ``PIL.Image``. It also accepts instances of ``numpy.ndarray``, which might come from loading images using `OpenCV `__. -:: +.. code-block:: python >>> import cv2 >>> decode(cv2.imread('pyzbar/tests/code128.png')) @@ -120,7 +120,7 @@ images using `OpenCV `__. You can also provide a tuple ``(pixels, width, height)``, where the image data is eight bits-per-pixel. -:: +.. code-block:: python >>> image = cv2.imread('pyzbar/tests/code128.png') >>> height, width = image.shape[:2] @@ -187,7 +187,7 @@ is eight bits-per-pixel. The default behaviour is to decode all symbol types. You can look for just your symbol types -:: +.. code-block:: python >>> from pyzbar.pyzbar import ZBarSymbol >>> # Look for just qrcode