Closed matanp closed 6 years ago
Create a function called read_json() that takes in a json key, and the full json string as an input. Outputs the string that will replace the latex variable.
For example: json_string = { "key1" : "10", "key2": { "value": 10, "units": "mg/L" } }
json_string = { "key1" : "10", "key2": { "value": 10, "units": "mg/L" } }
read_json("key1", json_string) will output 10 and read_json("key2", json_string) will output 10 mg/L
read_json("key1", json_string)
10
read_json("key2", json_string)
10 mg/L
This allows developers to make improvements to which json structures are allowed separately from how the top level json is iterated through.
Create a function called read_json() that takes in a json key, and the full json string as an input. Outputs the string that will replace the latex variable.
For example:
json_string = { "key1" : "10", "key2": { "value": 10, "units": "mg/L" } }
read_json("key1", json_string)
will output10
andread_json("key2", json_string)
will output10 mg/L
This allows developers to make improvements to which json structures are allowed separately from how the top level json is iterated through.