zet

Wondering if Go templates would be best for filters and snippets

Currently, most command line UNIX folk will write a quick bash script to take in lines and modify them based on what is being passed. But bash has horrible templating and this approach only works to a point (and is one of the main attractions of Perl to this day). What about Go templating?

Templates have a number of strong advantages:

What if we created a command that looked up the template in a configured collection and expected standard input that it would process either line by line or as an entire buffer.

z filter yt.linkify 📺

Base template syntax

We’d have to come up with a base syntax for the template: