Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I print syntax-highlighted Ruby code?

I use TextMate for my Ruby editing, but when printing files, the code isn't syntax highlighted. Are there any good programs for printing out well-formatted color-highlighted Ruby code?

like image 877
Mike Avatar asked Jul 09 '26 05:07

Mike


1 Answers

A good solution which I use is to print from TextMate via vim which gives you a syntax-highlighted and line-numbered result (or however you choose to configure it.) In addition to vim it requires ps2pdf but these are easy to install with macports etc.

The only limitation is that the file needs to be saved first.

See this page, which shows how to set up the macro as a TextMate 'command'.

like image 103
edavey Avatar answered Jul 11 '26 21:07

edavey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!