Method: Bloggit::TextFormatter.register
- Defined in:
- lib/bloggit/text_formatter.rb
.register(name, &block) ⇒ Object
Registers a formatter block with a given name.
In pages or posts, you can specify the text format in the header using:
format: Textile+.
Bloggit will look for a TextFormatter that’s been registered as :textile
21 22 23 24 25 |
# File 'lib/bloggit/text_formatter.rb', line 21 def register(name, &block) name = name.to_s.downcase.to_sym @formatters ||= {} @formatters[name] = block end |