Files

Class/Module Index [+]

Quicksearch

Jekyll::Converters::Markdown

Public Instance Methods

convert(content) click to toggle source
# File lib/jekyll/converters/markdown.rb, line 58
def convert(content)
  setup
  @parser.convert(content)
end
matches(ext) click to toggle source
# File lib/jekyll/converters/markdown.rb, line 49
def matches(ext)
  rgx = '^\.(' + @config['markdown_ext'].gsub(',','|') +')$'
  ext =~ Regexp.new(rgx, Regexp::IGNORECASE)
end
output_ext(ext) click to toggle source
# File lib/jekyll/converters/markdown.rb, line 54
def output_ext(ext)
  ".html"
end
setup() click to toggle source
# File lib/jekyll/converters/markdown.rb, line 9
def setup
  return if @setup
  @parser =
    case @config['markdown'].downcase
      when 'redcarpet' then RedcarpetParser.new(@config)
      when 'kramdown'  then KramdownParser.new(@config)
      when 'rdiscount' then RDiscountParser.new(@config)
      when 'maruku'    then MarukuParser.new(@config)
    else
      # So they can't try some tricky bullshit or go down the ancestor chain, I hope.
      if allowed_custom_class?(@config['markdown'])
        self.class.const_get(@config['markdown']).new(@config)
      else
        Jekyll.logger.error "Invalid Markdown Processor:", "#{@config['markdown']}"
        Jekyll.logger.error "", "Valid options are [ #{valid_processors.join(" | ")} ]"
        raise Errors::FatalException, "Invalid Markdown Processor: #{@config['markdown']}"
      end
    end
  @setup = true
end
third_party_processors() click to toggle source
# File lib/jekyll/converters/markdown.rb, line 39
def third_party_processors
  self.class.constants - ]
    KramdownParser
    MarukuParser
    RDiscountParser
    RedcarpetParser
    PRIORITIES
  ].map(&:to_sym)
end
valid_processors() click to toggle source
# File lib/jekyll/converters/markdown.rb, line 30
def valid_processors
  ]
    maruku
    rdiscount
    kramdown
    redcarpet
  ] + third_party_processors
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.