Colorized Ruby Source Listings/Printing

P

Patrick Hurley

I guess I am just old fashion, but sometimes when I am working on
piece of code (or just examining a nice bit of code), I like to print
it out so I can mark it up with fancy tools like my Pentel RSVP and
take it to the reading room.

So I query multitude: what tools do you use to print out your Ruby code?

Thanks
 
J

Jakub Hegenbart

Patrick said:
I guess I am just old fashion, but sometimes when I am working on
piece of code (or just examining a nice bit of code), I like to print
it out so I can mark it up with fancy tools like my Pentel RSVP and
take it to the reading room.

So I query multitude: what tools do you use to print out your Ruby code?
Scite is quite fine for me... ;-)

Jakub
 
N

Neil Stevens

Patrick said:
I guess I am just old fashion, but sometimes when I am working on
piece of code (or just examining a nice bit of code), I like to print
it out so I can mark it up with fancy tools like my Pentel RSVP and
take it to the reading room.

So I query multitude: what tools do you use to print out your Ruby code?

Vim can output highlighted text as html, which you could then print. It
ships with support for highlighting ruby, and the colors and styles it
uses for highlighting are fully configurable.

http://www.vim.org/
 
K

Keith Fahlgren

Vim can output highlighted text as html, which you could then print.
=A0It ships with support for highlighting ruby, and the colors and
styles it uses for highlighting are fully configurable.

http://www.vim.org/

Because it took me a while to figure out what Neil was saying, here's a=20
pointer in the right direction for the rest of us:

http://www.vim.org/scripts/script.php?script_id=3D330
(note that you can use the old 2html.vim if you don't want to install=20
anything).


PS: Thanks Neil, this is great!

HTH,
Keith
 
P

Patrick Hurley

Scite is quite fine for me... ;-)

FYI, I just notice scite has a -p command line option to print and
exit (if you do not use scite as your "regular" editor).

Thanks for the other suggestions as well (and I am still interested in
solutions that work for everyone else :). I also got enscript
running, but since I am on a Windows box and without a native
postscript printer, I would need to push it through ghostscript or
firefox to get it printed.
 
N

Nikolai Weibull

Neil said:
Patrick Hurley wrote:
Vim can output highlighted text as html, which you could then print. I= t
ships with support for highlighting ruby, and the colors and styles it
uses for highlighting are fully configurable.

And I=E2=80=99m working on providing an XML-based generic output-format t=
hat can
then be converted to whatever format you want (and in any unit you might
want as well) through XSLT. I=E2=80=99m primarily doing this to be able =
to
output stuff for inclusion in ConTeXt documents, but transforming it to
HTML will be just as easy.

nikolai

--=20
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
 
N

Nikolai Weibull

Because it took me a while to figure out what Neil was saying, here's
a pointer in the right direction for the rest of us:
=20
http://www.vim.org/scripts/script.php?script_id=3D330

This is probably not the thing he was talking about. Just issue

:source $VIMRUNTIME/syntax/2html.vim

in the buffer that you want to turn into highlighted HTML. Issue

:help 2html.vim

to get more information.
(note that you can use the old 2html.vim if you don't want to install
anything).

Seeing as how the script linked to above hasn't seen an update since
August, 2003, it is in fact the old 2html.vim. Bram last touched the
distributed syntax/2html.vim in February, 20005.

nikolai

--=20
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
 
B

Brian Schröder

I guess I am just old fashion, but sometimes when I am working on
piece of code (or just examining a nice bit of code), I like to print
it out so I can mark it up with fancy tools like my Pentel RSVP and
take it to the reading room.

So I query multitude: what tools do you use to print out your Ruby code?

Thanks

You can use this:

xemacs -nw -eval '(htmlize-file "$<" "$@")' -kill

where $< is the infile $@ is the outfile. I do an additonal
postprocessing script to turn the css inlined in the header into an
external css.

hope to help,

Brian
 
S

Stephan Mueller

* Patrick Hurley said:
So I query multitude: what tools do you use to print out your Ruby code?

Currently I use jEdit together with Robs plugin for editing Ruby code
(and editing in general). jEdit can print the code with syntax
highlightning and in color mode. There is also a html export plugin as
far as i know. HTH.


Cheers,

- Steph.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top