Sha256: fc0121a3f642890db355536cadef344817432664b00113d52aa5700881284d49

Contents?: true

Size: 778 Bytes

Versions: 18

Compression:

Stored size: 778 Bytes

Contents

require 'coderay'

def highlight_file( file, options = {} )
  id = options[:id] || "source"
  display = options[:display] || ""
  div( :id => id, :style => "display:#{display};" ) do 
    CodeRay.scan_file(file, :ruby).div(:line_numbers => :table, :css => :class)
  end
end

def highlight_me( options = {} )
  id = options[:id] || "source"
  display = options[:display] || ""
  div( :id => id, :style => "display:#{display};" ) do 
    CodeRay.scan_file(__FILE__, :ruby).div(:line_numbers => :table, :css => :class)
  end
end

def highlight_data( data, options = {} )
  id = options[:id] || "source"
  display = options[:display] || ""
  div( :id => id, :style => "display:#{display};" ) do 
    CodeRay.scan(data, :ruby).div(:line_numbers => :table, :css => :class)
  end  
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
bivouac-0.0.7 examples/bivouac_sample/app/helpers/source.rb
bivouac-0.1.0 examples/bivouac_sample/app/helpers/source.rb
bivouac-0.0.9 examples/bivouac_sample/app/helpers/source.rb
bivouac-0.0.8 examples/bivouac_sample/app/helpers/source.rb
bivouac-0.1.1 examples/bivouac_sample/app/helpers/source.rb
bivouac-0.1.2 examples/bivouac_sample/app/helpers/source.rb
bivouac-0.1.4 examples/bivouac_sample/app/helpers/source.rb
bivouac-0.1.3 examples/bivouac_sample/app/helpers/source.rb
bivouac-0.1.5 examples/bivouac_sample/app/helpers/source.rb
bivouac-0.1.6 examples/bivouac_sample/app/helpers/source.rb
bivouac-0.2.0 examples/bivouac_sample/app/helpers/source.rb
bivouac-0.2.1 examples/bivouac_sample/app/helpers/source.rb
bivouac-0.2.2 examples/bivouac_sample/app/helpers/source.rb
bivouac-0.2.3 examples/bivouac_sample/app/helpers/source.rb
bivouac-0.2.5 examples/bivouac_sample/app/helpers/source.rb
bivouac-0.4.0 examples/bivouac_sample/app/helpers/source.rb
bivouac-0.3.0 examples/bivouac_sample/app/helpers/source.rb
bivouac-0.2.4 examples/bivouac_sample/app/helpers/source.rb