class Jekyll::Converters::SmartyPants
For more info on converters see jekyllrb.com/docs/plugins/converters/
SmartyPants converter.
def convert(content)
content - String content of file (without front matter).
Logic to do the content conversion.
def convert(content) document = Kramdown::Document.new(content, @config) html_output = document.to_html.chomp if @config["show_warnings"] document.warnings.each do |warning| Jekyll.logger.warn "Kramdown warning:", warning.sub(%r!^Warning:\s+!, "") end end html_output end
def initialize(config)
def initialize(config) Jekyll::External.require_with_graceful_fail "kramdown" unless defined?(Kramdown) @config = config["kramdown"].dup || {} @config[:input] = :SmartyPants end
def matches(_ext)
ext - The String extension to check.
Takes one argument: the file's extension (including the dot).
Does the given extension match this converter's list of acceptable extensions?
def matches(_ext) false end
def output_ext(_ext)
ext - The String extension or original file.
Public: The extension to be given to the output file (including the dot).
def output_ext(_ext) nil end