Sha256: 285585a7afd895c06684bc4471ea256937722e44878a07f8ec20b061676f7bdb

Contents?: true

Size: 728 Bytes

Versions: 12

Compression:

Stored size: 728 Bytes

Contents

require "hikidoc"

require "rabbit/parser/base"

module Rabbit
  module Parser
    class Wiki < Base
    end
  end
end

require "rabbit/parser/wiki/output"

module Rabbit
  module Parser
    class Wiki
      unshift_loader(self)
      class << self
        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
      end

      include Element
      def parse
        parser = HikiDoc.new(RabbitOutput.new(@canvas),
                             :use_wiki_name => false)
        parser.compile(@source.read)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rabbit-2.0.6 lib/rabbit/parser/wiki.rb
rabbit-2.0.5 lib/rabbit/parser/wiki.rb
rabbit-2.0.4 lib/rabbit/parser/wiki.rb
rabbit-2.0.3 lib/rabbit/parser/wiki.rb
rabbit-2.0.2 lib/rabbit/parser/wiki.rb
rabbit-2.0.1 lib/rabbit/parser/wiki.rb
rabbit-2.0.0 lib/rabbit/parser/wiki.rb
rabbit-1.0.9 lib/rabbit/parser/wiki.rb
rabbit-1.0.8 lib/rabbit/parser/wiki.rb
rabbit-1.0.7 lib/rabbit/parser/wiki.rb
rabbit-1.0.6 lib/rabbit/parser/wiki.rb
rabbit-1.0.5 lib/rabbit/parser/wiki.rb