2

I want to be able to get colours for Ruby (or C# or F#) in the shells.

wirble does it nicely with IRB, but I want to be able to do:

> cat rakefile.rb | colorize

Does somebody know how I could do this? I know that github's language parsers are OSS - could they be used to read lines one by one and colourise them?

2 Answers 2

2

pygments does that for you: http://pygments.org/docs/cmdline/

Sign up to request clarification or add additional context in comments.

2 Comments

and you can just make an alias in you .bashrc like described in ralfebert.de/blog/tools/cat_syntax_highlighting
That just does this: xyz@ISOMORPHISM /d/code/oss/lib (dev) $ cat rubyfile.rb | pygmentize Usage: c:\Python27\Scripts\pygmentize-script.py [-l <lexer> ... , i.e. it's not reading anything.
0

You can try source-highlight as well.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.