Skip to content

Commit

Permalink
Merge pull request #119 from snopoke/patch-1
Browse files Browse the repository at this point in the history
readme formatting fixes
  • Loading branch information
h2non committed Apr 4, 2023
2 parents d7bec79 + 1b53113 commit fefc4dd
Showing 1 changed file with 30 additions and 29 deletions.
59 changes: 30 additions & 29 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,30 +187,31 @@ Extras
Extensions
----------

+--------------+----------------------------------------------+
| name | Example |
+==============+==============================================+
| len | - $.objects.`len` |
+--------------+----------------------------------------------+
| sub | - $.field.`sub(/foo\\\\+(.*)/, \\\\1)` |
+--------------+----------------------------------------------+
| split | - $.field.`split(+, 2, -1)` |
| | - $.field.`split(sep, segement, maxsplit)` |
+--------------+----------------------------------------------+
| sorted | - $.objects.`sorted` |
| | - $.objects[\\some_field] |
| | - $.objects[\\some_field,/other_field] |
+--------------+----------------------------------------------+
| filter | - $.objects[?(@some_field > 5)] |
| | - $.objects[?some_field = "foobar")] |
| | - $.objects[?some_field =~ "foobar")] |
| | - $.objects[?some_field > 5 & other < 2)] |
+--------------+----------------------------------------------+
| arithmetic | - $.foo + "_" + $.bar |
| (-+*/) | - $.foo * 12 |
| | - $.objects[*].cow + $.objects[*].cat |
+--------------+----------------------------------------------+

+--------------+-----------------------------------------------+
| name | Example |
+==============+===============================================+
| len | - ``$.objects.`len``` |
+--------------+-----------------------------------------------+
| sub | - ``$.field.`sub(/foo\\\\+(.*)/, \\\\1)``` |
| | - ``$.field.`sub(/regex/, replacement)``` |
+--------------+-----------------------------------------------+
| split | - ``$.field.`split(+, 2, -1)``` |
| | - ``$.field.`split(sep, segement, maxsplit)```|
+--------------+-----------------------------------------------+
| sorted | - ``$.objects.`sorted``` |
| | - ``$.objects[\\some_field]`` |
| | - ``$.objects[\\some_field,/other_field]`` |
+--------------+-----------------------------------------------+
| filter | - ``$.objects[?(@some_field > 5)]`` |
| | - ``$.objects[?some_field = "foobar")]`` |
| | - ``$.objects[?some_field =~ "foobar")]`` |
| | - ``$.objects[?some_field > 5 & other < 2)]`` |
+--------------+-----------------------------------------------+
| arithmetic | - ``$.foo + "_" + $.bar`` |
| (-+*/) | - ``$.foo * 12`` |
| | - ``$.objects[*].cow + $.objects[*].cat`` |
+--------------+-----------------------------------------------+
-
About arithmetic and string
---------------------------

Expand All @@ -228,10 +229,10 @@ Example with data::
'fish': 'bar'
}

| **cow + fish** returns **cowfish**
| **$.cow + $.fish** returns **foobar**
| **$.cow + "_" + $.fish** returns **foo_bar**
| **$.cow + "_" + fish** returns **foo_fish**
| ``cow + fish`` returns ``cowfish``
| ``$.cow + $.fish`` returns ``foobar``
| ``$.cow + "_" + $.fish`` returns ``foo_bar``
| ``$.cow + "_" + fish`` returns ``foo_fish``
About arithmetic and list
-------------------------
Expand All @@ -245,7 +246,7 @@ Example with data::
{'cow': 4, 'cat': 6}
]}

| **$.objects[\*].cow + $.objects[\*].cat** returns **[6, 9]**
| ``$.objects[\*].cow + $.objects[\*].cat`` returns ``[6, 9]``
More to explore
---------------
Expand Down

0 comments on commit fefc4dd

Please sign in to comment.