class Bridgetown::Converters::SmartyPants
SmartyPants
converter. For more info on converters see bridgetownrb.com/docs/plugins/converters/
Public Class Methods
new(config)
click to toggle source
# File lib/bridgetown-core/converters/smartypants.rb, line 27 def initialize(config) unless defined?(Kramdown) Bridgetown::Utils::RequireGems.require_with_graceful_fail "kramdown" end @config = config["kramdown"].dup || {} @config[:input] = :SmartyPants end
Public Instance Methods
convert(content)
click to toggle source
Logic to do the content conversion.
content - String content of file (without front matter).
Returns a String of the converted content.
# File lib/bridgetown-core/converters/smartypants.rb, line 49 def convert(content) document = Kramdown::Document.new(content, @config) html_output = document.to_html.chomp if @config["show_warnings"] document.warnings.each do |warning| Bridgetown.logger.warn "Kramdown warning:", warning.sub(%r!^Warning:\s+!, "") end end html_output end
output_ext(_ext)
click to toggle source
Public: The extension to be given to the output file (including the dot).
ext - The String extension or original file.
Returns The String output file extension.
# File lib/bridgetown-core/converters/smartypants.rb, line 40 def output_ext(_ext) nil end