# Stencil 0.1 Released

**URL:** <https://www.ruby-forum.com/t/stencil-0-1-released/180738>\
**Category:** Ruby\
**Created:** [December 28, 2009, 11:10am UTC](https://www.ruby-forum.com/t/stencil-0-1-released/180738 "2009-12-28T11:10:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [December 28, 2009, 11:10am UTC](https://www.ruby-forum.com/t/stencil-0-1-released/180738/1 "2009-12-28T11:10:23Z")

</div>

Stencil version 0.1 has been released!

Stencil is a templating library with a number of design goals.

- Limited code in templates. This isn’t meant to embed ruby in  
anything -  
it allows for simple control structures, since that’s typically what  
you need  
in a template, but full access to the Ruby  
interpreter is just a tempatation into sin. (From a separation of  
concerns  
standpoint.) There’s a certain amount of code available in  
conditionals and  
interpolations, since otherwise they’re much harder to do…

- Easy to extend. If you do need something extra from a template,  
not  
having it in the templating language is frustrating. It’s easy to add  
features to stencil, since they’re described in as well-designed  
classes.

- Generic output. Not everything is a website or a mime-encoded  
email. It’s  
nice to be able to spit out generic text from time to time.

- Data sourced from simple datatypes - hashes and array, referenced  
with data  
paths. Views can be extracted from any object, or built up in code.

Changes:

Initial release

Project: [http://rubyforge.org/project/stencil-templ/](http://rubyforge.org/project/stencil-templ/)  
Homepage: [http://stencil-templ.rubyforge.org/](http://stencil-templ.rubyforge.org/)

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [December 28, 2009, 11:51am UTC](https://www.ruby-forum.com/t/stencil-0-1-released/180738/2 "2009-12-28T11:51:44Z")

</div>

unknown wrote:

> Stencil version 0.1 has been released!
> 
> Stencil is a templating library with a number of design goals.

Can you explain what advantages it has over mustache and liquid?

Both are templating languages which don’t allow ruby code to be embedded  
directly and so are safe for untrusted users to write templates. Both  
are suitable for non-HTML uses (although mustache does do HTML entity  
escaping by default, I believe), and both are easily extended.

Your home page doesn’t give any examples of how to use it, and the  
README just says:

“This is a Really Cool Ruby Thing  
( That deserves better documentation than this. )”

So at the moment, I’d say you’re setting the barrier too high if you’re  
hoping to generate some interest. I am interested in templating  
languages in general, but I don’t want to have to reverse-engineer your  
project just to see whether it might be useful to me or not.

Regards,

Brian.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [December 29, 2009, 10:34am UTC](https://www.ruby-forum.com/t/stencil-0-1-released/180738/3 "2009-12-29T10:34:06Z")

</div>

On Mon, Dec 28, 2009 at 2:51 AM, Brian C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Your home page doesn’t give any examples of how to use it, and the  
> README just says:
> 
> “This is a Really Cool Ruby Thing  
> ( That deserves better documentation than this. )”

That’s since been updated. Apologies: the initial release announcement  
was  
a touch premature.

As to the advantages over liquid and mustache, I can’t be exhaustive.  
Both  
seem to be targeted at HTML, even if they allow for arbitrary text  
output.  
Stencil is designed, quite frankly, with console output in mind. As  
such,  
this release doesn’t have HTML tag output or HTML escaping.

Stencil is also strongly inspired by cs/template, and began because  
cs/template lacked a means to reference items above the current context  
(both cs/template and Stencil access data by means of paths into  
hash/array  
structures - inside of a loop, cs/template couldn’t refer to items  
higher up  
in the path)

Stencil also includes functionality to extract data into the hash/array  
structure the templates require, and RSpec matchers for quickly  
confirming  
that the intermediary form has the appropriate structure.

Hopefully that gives you some better idea if Stencil will suit your  
needs.

Judson

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [December 29, 2009, 6:36pm UTC](https://www.ruby-forum.com/t/stencil-0-1-released/180738/4 "2009-12-29T18:36:01Z")

</div>

Judson L. wrote:

> As to the advantages over liquid and mustache, I can’t be exhaustive.  
> Both  
> seem to be targeted at HTML, even if they allow for arbitrary text  
> output.

I have been using liquid for plain text output (generating router config  
files) without anything HTML-like getting in the way.

Anyway, thanks for updating the readme and giving the background info I  
was looking for.

Cheers,

Brian.
