Class: Rabbit::Parser::Wiki
- Includes:
- Element
- Defined in:
- lib/rabbit/parser/wiki.rb,
lib/rabbit/parser/wiki.rb,
lib/rabbit/parser/wiki/output.rb more...
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
permalink .format_name ⇒ Object
[View source]
19 20 21 |
# File 'lib/rabbit/parser/wiki.rb', line 19 def format_name "Wiki" end |
permalink .match?(source) ⇒ Boolean
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rabbit/parser/wiki.rb', line 23 def match?(source) extension = source.extension if extension.nil? head = source.read[0, 500] if head.respond_to?(:force_encoding) head.force_encoding("ASCII-8BIT") end /^!/.match(head) else /\A(?:hiki|wiki)\z/i =~ extension end end |
Instance Method Details
permalink #parse ⇒ Object
[View source]
38 39 40 41 42 |
# File 'lib/rabbit/parser/wiki.rb', line 38 def parse parser = HikiDoc.new(RabbitOutput.new(@canvas), :use_wiki_name => false) parser.compile(@source.read) end |