@@ -23,7 +23,9 @@ Motivation
2323
2424A useful feature that is common in other expression languages is the
2525ability to sort a JSON object based on a particular key. For example,
26- given a JSON object::
26+ given a JSON object:
27+
28+ .. code :: json
2729
2830 {
2931 "people" : [
@@ -46,7 +48,9 @@ would be evaluated against. In the simplest case, this expression would just
4648be an ``identifier ``, but more complex expressions could be used such as
4749``foo.bar.baz ``.
4850
49- A simple way to accomplish this might be to create a function like this::
51+ A simple way to accomplish this might be to create a function like this:
52+
53+ .. code :: python
5054
5155 sort_by(array arg1, expression)
5256
@@ -56,7 +60,9 @@ A simple way to accomplish this might be to create a function like this::
5660 sort_by(people, to_number(age_str))
5761
5862 However, there's a problem with the ``sort_by `` function as defined above.
59- If we follow the function argument resolution process we get::
63+ If we follow the function argument resolution process we get:
64+
65+ .. code :: python
6066
6167 sort_by(people, age)
6268
@@ -107,7 +113,9 @@ expression. Similarly how arrays can specify a type within a list using the
107113``expression->type `` syntax.
108114
109115Note that any valid expression is allowed after ``& ``, so the following
110- expressions are valid::
116+ expressions are valid:
117+
118+ .. code :: python
111119
112120 sort_by(people, & foo.bar.baz)
113121 sort_by(people, & foo.bar[0 ].baz)
0 commit comments