Forum: Ruby Colorized Ruby Source Listings/Printing

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2c51fec8183a5d21c4e11b430beabb47?d=identicon&s=25 phurley (Guest)
on 2005-12-05 18:35
(Received via mailing list)
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
560c83ff6b6600e39315a1cf75b7c229?d=identicon&s=25 tom (Guest)
on 2005-12-05 18:47
(Received via mailing list)
> So I query multitude: what tools do you use to print out your
> Ruby code?

RubyForge uses Enscript for colorizing; details are here:

http://tomcopeland.blogs.com/juniordeveloper/2005/...
l

and an example is here:

http://rubyforge.org/cgi-bin/viewcvs.cgi/rubygems/...
ot=rubygems&content-type=text/vnd.viewcvs-markup

Yours,

Tom
461b1da26b6b198ef014235928576d81?d=identicon&s=25 kyosuke (Guest)
on 2005-12-05 18:47
(Received via mailing list)
Patrick Hurley wrote:
> 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
3c155ef399326d533efc2eb91ac992e5?d=identicon&s=25 neil (Guest)
on 2005-12-05 18:51
(Received via mailing list)
Patrick Hurley wrote:
> 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/

--
Neil Stevens - neil@hakubi.us

'A republic, if you can keep it.' -- Benjamin Franklin
01d68aff859065b5cbc1cfc67cb16871?d=identicon&s=25 keith (Guest)
on 2005-12-05 19:16
(Received via mailing list)
On Monday 05 December 2005 12:47 pm, Neil Stevens wrote:
> > 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/

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:

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


PS: Thanks Neil, this is great!

HTH,
Keith
2c51fec8183a5d21c4e11b430beabb47?d=identicon&s=25 phurley (Guest)
on 2005-12-05 19:28
(Received via mailing list)
On 12/5/05, Jakub Hegenbart <kyosuke@seznam.cz> wrote:
> 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.
D1c54205b0ba8f40cbb774c6bc557376?d=identicon&s=25 mailing-lists.ruby-talk (Guest)
on 2005-12-05 19:36
(Received via mailing list)
Neil Stevens wrote:

> Patrick Hurley wrote:

> > 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.

And Iâ??m working on providing an XML-based generic output-format that can
then be converted to whatever format you want (and in any unit you might
want as well) through XSLT.  Iâ??m 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
D1c54205b0ba8f40cbb774c6bc557376?d=identicon&s=25 mailing-lists.ruby-talk (Guest)
on 2005-12-05 20:41
(Received via mailing list)
Keith Fahlgren wrote:

> On Monday 05 December 2005 12:47 pm, Neil Stevens wrote:

> > 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.

> 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:
>
> http://www.vim.org/scripts/script.php?script_id=330

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
6b4566518f6675477dab9b8ba813cf3c?d=identicon&s=25 ruby.brian (Guest)
on 2005-12-05 21:47
(Received via mailing list)
On 05/12/05, Patrick Hurley <phurley@gmail.com> wrote:
> 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
--
http://ruby.brian-schroeder.de/

Stringed instrument chords: http://chordlist.brian-schroeder.de/
9dfe8c734b0f9b37a4e218425c0a2138?d=identicon&s=25 gene.tani (Guest)
on 2005-12-05 23:21
(Received via mailing list)
Patrick Hurley wrote:
> 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

TMTOWTDI (but not as bad as python)

http://rubyforge.org/projects/syntax/
http://neugierig.org/software/ruby/
Fcc5cdf0f0f3e1a3a39c11ed4bf8d5e5?d=identicon&s=25 d454d (Guest)
on 2005-12-06 11:12
(Received via mailing list)
* Patrick Hurley <phurley@gmail.com> [051205 18:34]:

> 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.
This topic is locked and can not be replied to.