Class: Jekyll::Converters::Textile
Constant Summary
Constants inherited
from Plugin
Plugin::PRIORITIES
Instance Method Summary
collapse
highlighter_prefix, #highlighter_prefix, highlighter_suffix, #highlighter_suffix, #initialize
Methods inherited from Plugin
<=>, #<=>, descendants, #initialize, priority, safe
Instance Method Details
#convert(content) ⇒ Object
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/jekyll/converters/textile.rb', line 34
def convert(content)
setup
return RedCloth.new(content).to_html if @config['redcloth'].nil?
attrs = ['filter_classes', 'filter_html', 'filter_ids', 'filter_styles',
'hard_breaks', 'lite_mode', 'no_span_caps', 'sanitize_html']
r = RedCloth.new(content)
attrs.each do |attr|
r.instance_variable_set("@#{attr}".to_sym, @config['redcloth'][attr]) unless @config['redcloth'][attr].nil?
end
r.to_html
end
|
#extname_matches_regexp ⇒ Object
19
20
21
22
23
24
|
# File 'lib/jekyll/converters/textile.rb', line 19
def extname_matches_regexp
@extname_matches_regexp ||= Regexp.new(
'(' + @config['textile_ext'].gsub(',','|') +')$',
Regexp::IGNORECASE
)
end
|
#matches(ext) ⇒ Object
26
27
28
|
# File 'lib/jekyll/converters/textile.rb', line 26
def matches(ext)
ext =~ extname_matches_regexp
end
|
#output_ext(ext) ⇒ Object
30
31
32
|
# File 'lib/jekyll/converters/textile.rb', line 30
def output_ext(ext)
".html"
end
|
#setup ⇒ Object
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 Errors::FatalException.new("Missing dependency: RedCloth")
end
|