Need to identify compilable strategy
-
Nicholas Faiz
For example, a haml document
ok = @foo done - if @foo = Time.now - else there's no time like the present
compiles to this str, which is reflected as a method on the action_view object, and reused unless the template's timestamp is newer than the methods.
extend Haml::Helpers;_hamlout = @haml_buffer = Haml::Buffer.new(@haml_buffer, {:attr_wrapper=>"'", :format=>:xhtml, :autoclose=>["meta", "img", "link", "br", "hr", "input", "area", "param", "col", "base"], :preserve=>["textarea", "pre"], :ugly=>false});_erbout = _hamlout.buffer;__in_erb_template = true;; _hamlout.push_text("ok\n");haml_temp = @foo; haml_temp = _hamlout.push_script(haml_temp, false, false, false, false, false); _hamlout.push_text("done\n"); if @foo; haml_temp = Time.now; haml_temp = _hamlout.push_script(haml_temp, false, false, false, false, false); else; _hamlout.push_text("there's no time like the present\n");end; @haml_buffer = @haml_buffer.upper;_erbout;So, presumably the renshi parser should do something similar.
-
Nicholas Faiz
The problem with doing this, though, is that it means writing the template parser specifically for the Rails platform. I wonder how haml handles Sinatra integration?
-
Nicholas Faiz
Done for statements and conditional expressions.
-
Nicholas Faiz
- State changed from new to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.