Class: Rabbit::Parser::Wiki
- Includes:
- Element
- Defined in:
- lib/rabbit/parser/wiki.rb,
lib/rabbit/parser/wiki.rb,
lib/rabbit/parser/wiki/output.rb
Defined Under Namespace
Classes: RabbitOutput
Constant Summary
Constants included from ModuleLoader
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
Methods included from ModuleLoader
extend_object, #find_loader, #loaders, #push_loader, #unshift_loader
Constructor Details
This class inherits a constructor from Rabbit::Parser::Base
Class Method Details
.match?(source) ⇒ Boolean
19 20 21 22 23 24 |
# File 'lib/rabbit/parser/wiki.rb', line 19 def match?(source) return true if /\A(?:hiki|wiki)\z/i =~ source.extension.to_s head = source.read[0, 500] head.force_encoding("ASCII-8BIT") if head.respond_to?(:force_encoding) /^!/.match(head) end |
Instance Method Details
#parse ⇒ Object
28 29 30 31 32 |
# File 'lib/rabbit/parser/wiki.rb', line 28 def parse parser = HikiDoc.new(RabbitOutput.new(@canvas), :use_wiki_name => false) parser.compile(@source.read) end |