Module: Jekyll::Microtypo

Defined in:
lib/jekyll/microtypo.rb,
lib/jekyll/microtypo/version.rb

Constant Summary collapse

VERSION =
"2.0.2"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.settings(config) ⇒ Object



15
16
17
18
# File 'lib/jekyll/microtypo.rb', line 15

def self.settings(config)
  @settings ||= {}
  @settings[config.hash] ||= config["microtypo"] || {}
end

Instance Method Details

#microtypo(input, locale = "en_US") ⇒ Object

Example:

{{ content | microtypo: "fr_FR" }}


22
23
24
25
26
27
28
29
30
31
# File 'lib/jekyll/microtypo.rb', line 22

def microtypo(input, locale = "en_US")
  bucket = []

  recursive_parser(input, locale, bucket, QUEUE.length)

  # Clean empty lines
  bucket.join.tap do |result|
    result.gsub!(%r!\A\s*\n$!, "")
  end
end