New Templating Framework

I’m making a new open-source templating framework to be used with shotstack. The idea is that you can develop your templates using a feature-rich templating system and then preprocess it into a compatible shotstack template before sending it to shotstack. It’ll be written as a PHP library, but it should be trivial to use it as a webservice API or command-line tool as well.

I was going to wait to post it until it was done, but I thought it might be valuable to collect feedback before it’s fully operational. I’ve written basic documentation that I plan to use as requirements, so feel free to check them out and provide feedback or PRs.

Github: GitHub - CobaltBlueDW/ShotstackElements: A Template Framework for Shotstack

1 Like

I think there are some really good ideas here - will give it some more thought!

One of the most annoying things I’ve had to grapple with is that, because it’s self referential, the template has to be valid JSON prior to doing any processing.

e.g. To be able to reference something like {{scene.start}}, you have to have already done some initial parsing to know what scene.start is.

If the initial version of the template isn’t valid JSON (and doesn’t remain valid JSON through every round of parsing), then I’d have to develop my own progressive JSON parser, and I’m not that heavily invested. :slight_smile:

Anyways, that means anything cool you might want to do has to start inside a string, which feels at least a bit wonky.

I love this. This really has some potential to overcome some of the shortcomings of the templating system.

Can I try it out?

I haven’t finished debugging the initial build yet. I’ve been busy with some other things the past few days. I’ll post when I get it pushed.

I like where this is going. There’s no reason why a library cant be built on top of Shotstack to create features and functionality that is missing.

We had a similar idea a while back and created this: GitHub - shotstack/templates: Open source templates and template generating framework (ALPHA) for the Shotstack API.. It has a few built in components for making common tasks easier like subtitles, panels, etc… It’s Node.js but feel free to take any of the concepts from there and add to your library if you think they are useful.

First build has been pushed. It should have all the features mentioned in those example docks, and has passed basic tests.

Since the library supports composition of partial templates, and lazy loading of partial templates, it’d be cool to see a public library of template components (like those in that ^ git repo) that you could just pull into your videos.