CommonThread

HAML Broke My Textmate Footnotes

Posted by ben, Sat Jul 28 20:19:00 UTC 2007

I recently installed HAML to give it a try and noticed that on HAML pages my Texmate Footnotes weren’t showing up. If you are anything like me you are not quite sure how you made it before the Textmate Footnotes Plugin. That might be a stretch but at least you really like them and wish that they would show up on your HAML pages. I found an easy way to patch the footnotes plugin so that it runs for HAML pages as well.

open /vendor/plugins/footnotes/lib/textmate_footnotes.rb and change out the section in the add_footnotes! method that checks the file types … [“rhtml”, “rxhtml”] ... to include HAML ... [“rhtml”, “rxhtml”, “haml”]

Then restart script/server and you are in business

Filed Under: | Tags:

Comments

  1. Boots Boccaleone 09.15.07 / 12PM
    Unfortunately the layout link automatically assumes rhtml and won't work unless you change the layout_file method similar to the following code: def layout_file_name # change to reflect haml where there is no rhtml template layout = File.expand_path(@template.send(:full_template_path, @controller.active_layout, "rhtml")) unless File.exists?(layout) layout = File.expand_path( @template.send(:full_template_path, @controller.active_layout, "haml" )) end layout end

Have your say

A name is required. You may use HTML in your comments.




Categories