# html-template gem - old-style classic HTML template language / engine like it's 1999 (incl. back-to-the-future ERB converter)

**URL:** <https://rubytalk.org/t/html-template-gem-old-style-classic-html-template-language-engine-like-its-1999-incl-back-to-the-future-erb-converter/75193>\
**Category:** ruby-talk\
**Created:** [11 February 2020 13:40 UTC](https://rubytalk.org/t/html-template-gem-old-style-classic-html-template-language-engine-like-its-1999-incl-back-to-the-future-erb-converter/75193 "2020-02-11T13:40:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gerald\_Bauer1](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/gerald_bauer1/32/1852_2.png) [@Gerald\_Bauer1](https://rubytalk.org/u/Gerald_Bauer1)\
**Post date:** [11 February 2020 13:40 UTC](https://rubytalk.org/t/html-template-gem-old-style-classic-html-template-language-engine-like-its-1999-incl-back-to-the-future-erb-converter/75193/1 "2020-02-11T13:40:42Z")

</div>

Hello,

&nbsp;&nbsp;&nbsp;I've put together a new old-style classic HTML template language /  
engine [1] like it's 1999 that includes a back-to-the-future ERB  
converter too.

&nbsp;&nbsp;&nbsp;The original HTML::Template [2] package was written by Sam Tregar et al  
(in Perl with a first 1.0 release in 1999!).

&nbsp;&nbsp;&nbsp;For a short intro here's the students example from the tests:

```ruby
  require 'html/template'

   t = HtmlTemplate.new( <<TXT )
<TMPL_LOOP students>
<p>
Name: <TMPL_VAR name><br/>
GPA: <TMPL_VAR gpa>
</p>
</TMPL_LOOP>
TXT

    puts t.render( students: [ { name: 'Bluto Blutarsky', gpa: 0.0 },
                               { name: 'Tracey Flick', gpa: 4.0 } ])
#=> <p>
# Name: Bluto Blutarsky<br/>
# GPA: 0.0
# </p>
# <p>
# Name: Tracey Flick<br/>
# GPA: 4.0
# </p>

```

&nbsp;&nbsp;&nbsp;&nbsp;Happy text processing and template merging in ruby.

&nbsp;&nbsp;&nbsp;&nbsp;Cheers. Prost.

[1]: [https://github.com/feedreader/pluto/tree/master/html-template](https://github.com/feedreader/pluto/tree/master/html-template)  
[2]: [https://metacpan.org/pod/HTML::Template](https://metacpan.org/pod/HTML::Template)
