-
Notifications
You must be signed in to change notification settings - Fork 10
Description
What?
If you have not read about KDL its not too late! Here https://kdl.dev give it a look
One of the issues I find constantly when authoring JSON (output) via Twig templates is that you have to handle output by keeping track of the commas, specially when merging two source data arrays (e.g Documents and Images) coming for a IIIF Manifest. But also because its really made for Machines (and works lovely/well) but not for humans to write. YAML on the other side has this thing about tabs/identations. And happens that keeping those in touch via a Twig Template (if you have tried to make the output pretty) is a nightmare!
So. KDL solves many of those issue, its quite verbose, simpler and we can of course (for the sake of the output) quickly serialized back into JSON on the fly to be e.g JSON-LD compliant of manifests, or GeoJSON, etc.
PHP library is there 👏 and there is even (not needed in our case yet since we are Core JSON/Storage is JSON, etc) a Query Language Spec/definition that looks pretty JMESPATH so neat too.
I will give this a try tomorrow (Sept 14th of 2021) after all our trainings and deliverables. I see some chances of making @alliomeria @aksm and @giancarlobi live easier.
Again, the idea here is that If you want to create JSON via a Twig template you can Create KDL and we transform the output. Easier to navigate. Hope you like the idea!