Skip to content

jmax/railslife-highlighter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

railslife sintax highlighter

railslife-highliter is a very simple and lightweight sintax highlighter for ruby.

Dependencies

This script requires the syntax gem.


  (sudo) gem install syntax

Syntax

Very simple:


  ruby railslife-highliter.rb /path/to/your/ruby/code.rb

Example

Let’s say you have a code.rb file with this content:


  class Hello
    def say_hi
      puts "hi, railslife-highlighter"
    end
  end

You run:


  ruby railslife-highliter.rb code.rb

The result output you’ll get:


<pre><span class="keyword">class </span><span class="class">Hello</span>
  <span class="keyword">def </span><span class="method">say_hi</span>
    <span class="ident">puts</span> <span class="punct">&quot;</span>
    <span class="string">hi, railslife-highlighter</span><span class="punct">&quot;</span>
  <span class="keyword">end</span>
<span class="keyword">end</span>

That’s all for now.

About

railslife-highlighter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages