Hi everyone! So, I just finished a major rewrite of my template engine library, Squirrelly (the new version can be found here).
Features include:
Code examples:
Sqrl.Render("my favorite template engine is {{it.fav}}", {fav: "Squirrelly"})
// my favorite template engine is Squirrelly
Items: {{it.items | join (", ") | capitalize}}
var eachTemplate = `The Daugherty's have 8 kids. Their names are:
{{~each (it.kids) => val, index}}
{{~if(index < it.kids.length - 1_}}
{{val}},
{{_#else_}}
and {{val}}
{{_/if}}
{{_/each}}`
var res = Render(eachTemplate, { kids: ['Ben', 'Polly', 'Joel', 'Phronsie', 'Davie'] })
// The Daugherty's have 8 kids. Their names are:
// Ben,
// Polly,
// Joel,
// Phronsie,
// and Davie
{{~try}}
This won't work: {{ error }}
{{#catch => err}}
Uh-oh, error! Message was '{{err.message}}'
{{/try}}
Now, for the question parts of this post:
First of all, I decided to go with doT-styled references to reference data (but without the =): {{it.someValue}}. This means that I allow what doT calls 'evaluate syntax' (just sticking in native code) like this: {{!whatever}}.
My other question is about publishing. Should I publish as squirrelly-next on NPM, or publish it as version 8 of Squirrelly, or choose another name (like Gopher?)
No responses yet.