Only require pygments where it's needed.
This commit is contained in:
parent
1c4f5b4ee5
commit
3c218d2dcd
|
@ -24,7 +24,6 @@ require 'English'
|
|||
# 3rd party
|
||||
require 'liquid'
|
||||
require 'maruku'
|
||||
require 'pygments'
|
||||
require 'colorator'
|
||||
|
||||
# internal requires
|
||||
|
|
|
@ -9,6 +9,8 @@ module Jekyll
|
|||
@config['redcarpet']['extensions'].each { |e| @redcarpet_extensions[e.to_sym] = true }
|
||||
|
||||
@renderer ||= Class.new(Redcarpet::Render::HTML) do
|
||||
require 'pygments'
|
||||
|
||||
def block_code(code, lang)
|
||||
lang = lang && lang.split.first || "text"
|
||||
output = add_code_tags(
|
||||
|
|
|
@ -49,6 +49,8 @@ eos
|
|||
end
|
||||
|
||||
def render_pygments(context, code)
|
||||
require 'pygments'
|
||||
|
||||
@options[:encoding] = 'utf-8'
|
||||
|
||||
output = add_code_tags(
|
||||
|
|
Loading…
Reference in New Issue