Ever since my Ore gem template project, I've wanted to write a generic project templating library, so projects could stop re-inventing -gen commands. TIL Python's cookiecutter, which has many of the same ideas. Even uses Liquid Templates. github.com/audreyr/cookiecutte

Some dream features:

* Composable template objects: `union_template = foo_template + bar_template`
* Support for partials or includes.
* Liquid and/or ERb support.
* Dynamic file/dir names.
* Automatic indentation/formatting (think liquid filters).
* Template macros for generating your choice of rdoc, markdown, or textile formatting (ex: ul, li, a, pre)

Show thread

I like how cookiecutter uses Liquid both in file/dir names and file bodies. While it's harder to register new Liquid functions, it does prevent arbitrary nasty code from hiding in templates. Although, the Ruby ecosystem is very familiar with ERb. Are there use-cases where ERb can do things that Liquid cannot?

Show thread

You would think the Ruby community would be more familiar with Liquid, given how Jekyll uses it.

Sign in to participate in the conversation

A Mastodon instance for Rubyists & friends