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

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -