archieml-js icon indicating copy to clipboard operation
archieml-js copied to clipboard

In-line JSON parsing

Open tonyfast opened this issue 10 years ago • 1 comments

A really nice way to augment an Archie document is to add existing data. I was curious if being able to add single line minified JSON support to archie would work?

Archie already recognizes the braces as triggers. If it could recognize a line was json and push that to the scope.

tonyfast avatar Mar 12 '15 12:03 tonyfast

One of the ideas of ArchieML is to keep writers from getting surprised with how the document gets parsed, and I think allowing it to parse anything that looks like a JSON object as data might confuse people. I could also see people wanting to include JSON-like text and have it be treated as a comment, just like plain text:

Note, paste the following line into the CMS to turn on the slideshow:
{"testing": "data", ... }

I'd normally suggest just merging in the JSON after parsing; is there an example where you'd find it better to include it in a source AML document?

abstrctn avatar Mar 16 '15 22:03 abstrctn