views:

268

answers:

4

I'm searching for a tool that will take a source directory and produce a single PDF containing the source code, preferably with syntax highlighting.

I would like to read the PDF on my phone, in order to get familiar with a code-base, or just to see what I can learn by reading a lot of code. I will most often be reading Ruby.

I would prefer if the tool ran on Linux. I don't mind paying for a tool if it is particularly good.

Any suggestions?

+1  A: 

PDF is no good for reflowing. You might like a html based solution better.

And in reading existing code, a lineair model is no good. You need to jump from one file to the other. A hypertext model with history would probably work best on the limited screen estate of a phone. It should borrow some features of the smalltalk IDEs (jump to senders, implementors).

For the UI, take a look at clamato

Stephan Eggermont
+1 Good point re reflow. I'll just have to figure out how to open HTML docs on my phone - which *should* be easier than opening PDF you might think.
Joel
Depends on the phone, I guess. I was thinking iPhone or similar...
Stephan Eggermont
A: 

The SciTE editor can export the currently edited file (with syntax highlighting) to PDF (and HTML, RTF, LaTeX and XML).

Alas, it doesn't have batch conversion capability, but IIRC somebody made a batch tool out of this code base.

PhiLho
+1  A: 

You could wipe something up yourself with Prawn and Ultraviolet.

Michael Kohl
Ultraviolet looks very cool. Thanks for pointing it out.
Joel
A: 

GNU source-highlight supports many languages and can output LaTeX in particular that can be converted to pdf.

J.F. Sebastian