rubbish-erb-parser
v1.0.1
Published
A really rubbish erb parser that only handles a tiny subset of erb.
Downloads
6
Readme
rubbish-erb-parser
This is an erb parser which only supports a tiny subset of erb. We're using it in the development of components at Lost My Name, but this library is basically not much use for many things.
It's a subset because the Ruby you write has to be valid JavaScript. The following will not render:
<%= image_helper 'dog.png', foo: 'bar' %>
You have to write the following instead:
<%= image_helper('dog.png', { foo: 'bar' }) %>
Niiice.
Also it currently only supports two helpers, image_path
and image_tag
.
And it doesn't support <% %>
at all because nunjucks didn't like it.
Install
$ npm install --save rubbish-erb-parser
License
If for some reason you want to use this, it's released under the MIT license.