diff options
Diffstat (limited to 'macros/latex/contrib/jsonparse/README.md')
-rw-r--r-- | macros/latex/contrib/jsonparse/README.md | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/macros/latex/contrib/jsonparse/README.md b/macros/latex/contrib/jsonparse/README.md index 9576069ea3..b2253c2a85 100644 --- a/macros/latex/contrib/jsonparse/README.md +++ b/macros/latex/contrib/jsonparse/README.md @@ -1,4 +1,4 @@ -![Version 0.5.5](https://img.shields.io/badge/version-0.5.5-blue) +![Version 0.5.6](https://img.shields.io/badge/version-0.5.6-blue) # The `jsonparse` package @@ -12,35 +12,34 @@ Let's assume a file with the name `example.json` is stored in the working direct ``` { - "first_name": "John", - "last_name": "Smith", - "is_alive": true, - "age": 27, + "givenName": "Joe", + "familyName": "Public", + "points": 1.7, + "hasCertification": true, "address": { - "street_address": "21 2nd Street", - "city": "New York", - "state": "NY", - "postal_code": "10021-3100" + "streetAddress": "10 Main St", + "locality": "Cityville", + "postalCode": "12345" }, - "phone_numbers": [ + "contactPoint": [ { - "type": "home", - "number": "212 555-1234" + "contactType": "office", + "telephone": "+1 (555) 555-1234" }, { - "type": "office", - "number": "646 555-4567" + "contactType": "mobile", + "telephone": "+1 (555) 555-6789" } ], "children": [ - "Catherine", - "Thomas", - "Trevor" + "Tom, + "Doug", + "Harry" ], - "spouse": null + "memberOf": null } ``` -We can store it in the token variable `\myJSONdata` using the command `\JSONParseFromFile{\myJSONdata}{example.json}`. Calling the command `\JSONParseGetValue{\myJSONdata}{phone_numbers[0].number}` would then result in the output `212 555-1234` (indices are zero-based per default). +We can store it in the token variable `\myJSONdata` using the command `\JSONParseFromFile{\myJSONdata}{example.json}`. Calling the command `\JSONParseGetValue{\myJSONdata}{contactPoint[0].telephone}` would then result in the output `+1 (555) 555-1234` (indices are zero-based per default). This package including all files is subject to the LPPL 1.3c license. |