views:

189

answers:

1

I want to print every source code file in a Rails app (Ruby) and an Android App (Java). Are there plugins for Netbeans, Eclipse or Notepad++ which I can use for this?

I don't want to code anything, I just want to click on a menu (or type a command) that says: print every file in this project (with the syntax highlighting provided by the IDE or editor, of course).

+1  A: 

Since you are mentioning Notepad++, I assume that you are using Windows.

While I don't have an answer suitable for the Windows environment, I do know a way to do this in a Linux/Unix environment. Basically you could use a command like this:

a2ps `find . -name "*.java"` --pro=color -o src.ps

in the root directory of the source tree. There will be a postscript file called "src.ps" in the directory that you ran the command from. This can be looked at by some pdf readers, or you can print it directly to your standard printer by replacing "-o src.ps" with "-d". ie:

a2ps `find . -name "*.java"` --pro=color -d

I tested this with some java code and it seems to work fine, though not with the same code style as for example eclipse, but rather the style of the a2ps command. I don't know if this works for ruby, but this stylesheet might be useful in the worst case.

Just get a hold of a Linux environment, configure a printer and off you go! (Might or might not be worth it though ;))

Simon Lindgren
Thanks for the input - since I needed this quick and you're right I'm on Windows I ended up manually opening each file and printing it. Your post might be useful for other people though, so if no one else gives an answer I'll accept it in a few.
JRL
I have updated the second command to actually do what I wrote it did. Previously it would print directly to stdout.
Simon Lindgren