by SolarUpNote · 13y ago · 0 comments
For example: a component that lists blog posts could be represented by:
{
options:{
elements:[image, title, author, date]
},
criteria:{
sort:date.desc,
published:true,
limit:10
},
request_vars:{page:3}
}
That would show the last 10 posts that are published, ordered by date, on page 3 of the results.That's a simple example, this site: volumeone.org is built almost entirely this way.
Since it's in JSON format, JavaScript can be used to build UIs that build the components and layouts.
As for escaping special characters: I've run into that a lot, and I agree it is very annoying. God help you if you want to specify regexes on lines.
So for a lot of my YAML-ish applications, where YAML is used for user templating or configuration, I run everything through a really simple postprocessor (often by encapsulating non-digit lines with single quotes, and a few other tweaks) and that seems to work well for me. That way the user only has to type the bare minimum (no double quotes, no curly braces, no/fewer commas), and what they write "just works."