class Rabbit::Parser::Wiki

Public Class Methods

format_name() click to toggle source
# File lib/rabbit/parser/wiki.rb, line 19
def format_name
  "Wiki"
end
match?(source) click to toggle source
# 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

Public Instance Methods

parse() click to toggle source
# 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