Printing project code - way to copy into one doc?

Hi,

Anyone know a way to easily printout all code in a project, say a plugin
that you download and want to read offline? Currently I open each file
up and copy/paste into word, then when I print I adjust the printout to
be double-sided and multiple pages per sheet (i.e. compress).

Would be great to have something that collects all text in a directory
into one text file. Anything exist for this?

Tks

Greg H. wrote:

Hi,

Anyone know a way to easily printout all code in a project, say a plugin
that you download and want to read offline? Currently I open each file
up and copy/paste into word, then when I print I adjust the printout to
be double-sided and multiple pages per sheet (i.e. compress).

Would be great to have something that collects all text in a directory
into one text file. Anything exist for this?

Tks

It looks like you are using Windows if you’re using Word. Do yourself a
favor and download some Unix tools and you can do something like this:

find ./ -iregex ‘.(.rb|readme|install).’ | sort | while read in;
do printf “\n\n####\n# FILE: %s\n####\n\n” ${in} >> onebigfile; cat
“${in}” >> onebigfile; done

This will dump all ruby, readme, and install (you can add to it) files
for the current directory into one big file looking something like this:

FILE: ./README

Contents of the readme file…

FILE: ./init.rb

Contents of init.rb…

and so on.

This would save you the tedious copy and paste step, requiring that you
open just the one big file.

Also, depending on what you’re wanting to look at, rdoc might work for
you:

http://www.ruby-doc.org/stdlib/libdoc/rdoc/rdoc/classes/RDoc.html

Curtis S. wrote:

This will dump all ruby, readme, and install (you can add to it) files
for the current directory

Correction: “current directory” should be “current directory and all
sub-directories under that directory”

Also, cygwin should have all of these command-line tools for Windows:

http://www.cygwin.com/

When I have to develop on Windows, I always install this first!

wow, excellent Curtis - thanks very much