Sha256: 4b5c150e47405b9c732d7ee30b7f1eb8d1d7561fd8f5e6d8a852dac5d7748cbb

Contents?: true

Size: 939 Bytes

Versions: 2

Compression:

Stored size: 939 Bytes

Contents

require 'parslet'
require 'haml'

begin
  require 'slim'
rescue LoadError; end

require 'erb'

module Shortcode

  class << self
    attr_writer :configuration, :presenters
  end

  def self.process(string, additional_attributes=nil)
    Shortcode::Processor.new.process string, additional_attributes
  end

  def self.setup
    yield configuration
  end

  def self.register_presenter(presenter)
    presenters[presenter.for.to_sym] = presenter
  end

  private

    def self.presenters
      @presenters ||= {}
    end

    def self.configuration
      @configuration ||= Configuration.new
    end

end

require 'shortcode/version'
require 'shortcode/configuration'
require 'shortcode/parser'
require 'shortcode/presenter'
require 'shortcode/processor'
require 'shortcode/transformer'
require 'shortcode/tag'
require 'shortcode/exceptions'
require 'shortcode/railtie' if defined?(Rails) && Rails::VERSION::MAJOR >= 3

Shortcode.setup {}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shortcode-0.3.3 lib/shortcode.rb
shortcode-0.3.2 lib/shortcode.rb