Module: HiLite

Defined in:
lib/hi-lite.rb,
lib/hi-lite/parser.rb,
lib/hi-lite/css_file.rb,
lib/hi-lite/css_embedder.rb

Defined Under Namespace

Classes: CssEmbedder, CssFile, Parser

Class Method Summary collapse

Class Method Details

.hilite(code, opts = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/hi-lite.rb', line 8

def hilite(code, opts = {})
  opts = {
    :syntax => "ruby",
    :line_numbers => true,
    :theme => "eiffel",
    :headers => false
  }.merge(opts)
  embed_css(parse(code, opts), opts[:theme])
end

.lang_listObject



22
23
24
# File 'lib/hi-lite.rb', line 22

def lang_list
  Uv.syntaxes
end

.nice_lang_listObject



26
27
28
# File 'lib/hi-lite.rb', line 26

def nice_lang_list
  lang_list.inject(Hash.new) { |langs, s| langs.merge!({ s => nicer(s) }) }
end

.themes_listObject



18
19
20
# File 'lib/hi-lite.rb', line 18

def themes_list
  Uv.themes
end