Class: Jekyll::TextileConverter

Inherits:
Converter show all
Defined in:
lib/jekyll/converters/textile.rb

Constant Summary

Constants inherited from Plugin

Plugin::PRIORITIES

Instance Method Summary collapse

Methods inherited from Converter

#initialize, pygments_prefix, #pygments_prefix, pygments_suffix, #pygments_suffix

Methods inherited from Plugin

<=>, inherited, #initialize, priority, safe, subclasses

Constructor Details

This class inherits a constructor from Jekyll::Converter

Instance Method Details

#convert(content) ⇒ Object



27
28
29
30
# File 'lib/jekyll/converters/textile.rb', line 27

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

#matches(ext) ⇒ Object



19
20
21
# File 'lib/jekyll/converters/textile.rb', line 19

def matches(ext)
  ext =~ /textile/i
end

#output_ext(ext) ⇒ Object



23
24
25
# File 'lib/jekyll/converters/textile.rb', line 23

def output_ext(ext)
  ".html"
end

#setupObject



9
10
11
12
13
14
15
16
17
# File 'lib/jekyll/converters/textile.rb', line 9

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