Re: Digest for guardians-of-the-temple@googlegroups.com - 2 updates in 1 topic

15 views
Skip to first unread message

kee...@thebrocks.net

unread,
Jun 6, 2016, 11:00:20 PM6/6/16
to Digest recipients
Temple is a great framework for writing template languages. Slim uses it, as does hamlit (a haml derivative)

They have a an erb implementation that performs very well. I'm sure it would allow you to introduce your filter.
On Mon, Jun 6, 2016 at 8:22 PM <guardians-o...@googlegroups.com> wrote:
Roman Usherenko <roman.u...@gmail.com>: Jun 06 02:49AM -0700

Hi!
 
Anyone knows a nice way to minify HTML output of erb templates in Rails?
Right now I use a middleware that gsubs "\n"'s between close and open tags,
but this happens on each page load and depending on a page size can be
taxing on performance.
 
I'm looking to write some kind of a template engine (based on, or
compositing Erubis), that will tap into Rails template handlers chain so
that the compiled result will be cached by rails. Ideally I also do not
want to change all my template files extension from *.erb to something else.
 
Any advises?
Magnus Holm <jud...@gmail.com>: Jun 06 11:55AM +0200

Hi Roman,
 
I don't know of any HTML-aware ERB-templates. Slim/Haml handles HTML in its
syntax, and thus have way more control over what it generates. How
HTML-aware do you want the template engine to be? Should it also catch
invalid HTML?
 
I also don't know how to hook into Rails' template engine. But that's easy
to figure out.
 
 
// Magnus Holm
 
On Mon, Jun 6, 2016 at 11:49 AM, Roman Usherenko <roman.u...@gmail.com>
wrote:
 
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to guardians-of-the-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages