Skip to content

Commit 31ec38d

Browse files
committed
Merge pull request #99 from moreati/develop
Syntax highlight python examples
2 parents dab460c + dfb7419 commit 31ec38d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

README.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,19 @@ API
4848

4949
The ``jmespath.py`` library has two functions
5050
that operate on python data structures. You can use ``search``
51-
and give it the jmespath expression and the data::
51+
and give it the jmespath expression and the data:
52+
53+
.. code:: python
5254
5355
>>> import jmespath
5456
>>> path = jmespath.search('foo.bar', {'foo': {'bar': 'baz'}})
5557
'baz'
5658
5759
Similar to the ``re`` module, you can use the ``compile`` function
5860
to compile the JMESPath expression and use this parsed expression
59-
to perform repeated searches::
61+
to perform repeated searches:
62+
63+
.. code:: python
6064
6165
>>> import jmespath
6266
>>> expression = jmespath.compile('foo.bar')
@@ -75,7 +79,9 @@ Options
7579
You can provide an instance of ``jmespath.Options`` to control how
7680
a JMESPath expression is evaluated. The most common scenario for
7781
using an ``Options`` instance is if you want to have ordered output
78-
of your dict keys. To do this you can use either of these options::
82+
of your dict keys. To do this you can use either of these options:
83+
84+
.. code:: python
7985
8086
>>> import jmespath
8187
>>> jmespath.search('{a: a, b: b},

0 commit comments

Comments
 (0)