Sha256: 1e7ebd5524afc651e7b6a992318f6093aaa2f894619d9d4902b6fbc7637e99f6

Contents?: true

Size: 722 Bytes

Versions: 3

Compression:

Stored size: 722 Bytes

Contents

module Jekyll

  class TextileConverter < Converter
    safe true

    pygments_prefix '<notextile>'
    pygments_suffix '</notextile>'

    def setup
      return if @setup
      require 'redcloth'
      @setup = true
    rescue LoadError
      STDERR.puts 'You are missing a library required for Textile. Please run:'
      STDERR.puts '  $ [sudo] gem install RedCloth'
      raise FatalException.new("Missing dependency: RedCloth")
    end

    def matches(ext)
      rgx = '(' + @config['textile_ext'].gsub(',','|') +')'
      ext =~ Regexp.new(rgx, Regexp::IGNORECASE)
    end

    def output_ext(ext)
      ".html"
    end

    def convert(content)
      setup
      RedCloth.new(content).to_html
    end
  end

end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
jekyll-0.11.2 lib/jekyll/converters/textile.rb
vanity-1.7.1 vendor/ruby/1.9.1/gems/jekyll-0.11.0/lib/jekyll/converters/textile.rb
jekyll-0.11.0 lib/jekyll/converters/textile.rb