Sha256: 1f77e9a8d8f3d5b8e0c3d3f4a437774d86d980495a6f20daa062670e5886c408

Contents?: true

Size: 933 Bytes

Versions: 3

Compression:

Stored size: 933 Bytes

Contents

require 'rdocsupport'
require 'chunks/chunk'

# The markup engines are Chunks that call the one of RedCloth, BlueCloth
# or RDoc to convert text. This markup occurs when the chunk is required
# to mask itself.
module Engines
  class Textile < Chunk::Abstract
    def self.pattern() /^(.*)$/m end
    def mask(content)
      RedCloth.new(text,content.options[:engine_opts]).to_html
    end
    def unmask(content) self end
  end

  class Markdown < Chunk::Abstract
    def self.pattern() /^(.*)$/m end
    def mask(content)
      BlueCloth.new(text,content.options[:engine_opts]).to_html
    end
    def unmask(content) self end
  end

  class RDoc < Chunk::Abstract
    def self.pattern() /^(.*)$/m end
    def mask(content)
      RDocSupport::RDocFormatter.new(text).to_html
    end
    def unmask(content) self end
  end

  MAP = { :textile => Textile, :markdown => Markdown, :rdoc => RDoc }
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
Pimki-1.0.092 app/models/chunks/engines.rb
Pimki-1.1.092 app/models/chunks/engines.rb
Pimki-1.2.092 app/models/chunks/engines.rb