ruby - Middleman, where can I add custom methods, which modify output of the views -


i using middleman building api description web page, , wonder if possible define methods somewhere used parse yaml in desired format, looking place can put helper methods

i put mine in config.rb inside helpers block, e.g.

helpers   def emphasise word     word ?       "<em>#{word}</em>" :       word   end    def bracket word     word ?       "(#{word})" :       word   end end 

that helper in scope use in template.


edit: found the section of docs defining custom helpers


Comments

Popular posts from this blog

Upgrade php version of xampp not success -

amazon web services - S3 and apache mod_proxy with basic authentication -

powershell - This solution contains one or more assemblies targeted for the global assembly cache -