aboutsummaryrefslogtreecommitdiff
path: root/plugins/pygments_code.rb
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--plugins/pygments_code.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/pygments_code.rb b/plugins/pygments_code.rb
index 8b851a3b..c0f4de92 100644
--- a/plugins/pygments_code.rb
+++ b/plugins/pygments_code.rb
@@ -6,7 +6,7 @@ PYGMENTS_CACHE_DIR = File.expand_path('../../.pygments-cache', __FILE__)
FileUtils.mkdir_p(PYGMENTS_CACHE_DIR)
module HighlightCode
- def highlight(str, lang)
+ def self.highlight(str, lang)
lang = 'ruby' if lang == 'ru'
lang = 'objc' if lang == 'm'
lang = 'perl' if lang == 'pl'
@@ -15,7 +15,7 @@ module HighlightCode
tableize_code(str, lang)
end
- def pygments(code, lang)
+ def self.pygments(code, lang)
if defined?(PYGMENTS_CACHE_DIR)
path = File.join(PYGMENTS_CACHE_DIR, "#{lang}-#{Digest::MD5.hexdigest(code)}.html")
if File.exist?(path)
@@ -33,7 +33,7 @@ module HighlightCode
end
highlighted_code
end
- def tableize_code (str, lang = '')
+ def self.tableize_code (str, lang = '')
table = '<div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers">'
code = ''
str.lines.each_with_index do |line,index|