Module: Nitro::Markup
- Included in:
- FeedHelper, MarkupCompiler, MarkupKit, MarkupKit
- Defined in:
- lib/nitro/markup.rb
Overview
Generalised Markup transformations.
The expand methods evaluate (expand) the markup code to produce the final content. The compact methods reverse this process to create the original markup code. Not all markup transformations are reversible.
When this library is included, the default PropertyUtils implementation is overriden to add markup support.
Examples
Define your custom markup methods like this:
module Markup
def markup_simple
...
end
def markup_special
...
end
# maps the {{..}} macro
alias_method :sanitize, :markup_simple
# maps the {|..|} macro
alias_method :markup, :markup_special
end
here comes the #objobj.body # => prints the expanded version.
obj.body = markup(@params['body'])