Module: Jazzy::Highlighter

Defined in:
lib/jazzy/highlighter.rb

Overview

This module helps highlight code

Defined Under Namespace

Classes: Formatter

Constant Summary collapse

SWIFT =
'swift'.freeze
OBJC =
'objective_c'.freeze

Class Method Summary collapse

Class Method Details

.highlight(source, language) ⇒ Object



30
31
32
# File 'lib/jazzy/highlighter.rb', line 30

def self.highlight(source, language)
  source && Rouge.highlight(source, language, Formatter.new(language))
end

.highlight_objc(source) ⇒ Object



26
27
28
# File 'lib/jazzy/highlighter.rb', line 26

def self.highlight_objc(source)
  highlight(source, OBJC)
end

.highlight_swift(source) ⇒ Object



22
23
24
# File 'lib/jazzy/highlighter.rb', line 22

def self.highlight_swift(source)
  highlight(source, SWIFT)
end