Forum: Ruby Colored syntax output

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.
9618e8fca8d72bf01814276c53c2568c?d=identicon&s=25 Robert MannI (Guest)
on 2006-06-10 23:51
(Received via mailing list)
Hello!

Maybe someone here knows how to do this:

I have some Ruby code, and I need it in a syntax colored HTML output
format.

Is there any easy way to do this, maybe the "ruby" binary can do this?


Thanks alot,
Rob
Bbc4b3fca1ae3161257a8636145b424d?d=identicon&s=25 Elliot Temple (Guest)
on 2006-06-11 00:18
(Received via mailing list)
On Jun 10, 2006, at 2:48 PM, Robert MannI wrote:

> Hello!
>
> Maybe someone here knows how to do this:
>
> I have some Ruby code, and I need it in a syntax colored HTML
> output format.
>
> Is there any easy way to do this, maybe the "ruby" binary can do this?

enscript --color --language=html -Eruby --output=blah.html blah.rb

you may need to add knowledge of ruby syntax to the appropriate
enscript file. i remember this involved finding the ruby-related
stuff with google and pasting it into a file. you may also need to
install enscript. i didn't. i'm on OS X.

-- Elliot Temple
http://www.curi.us/blog/
2ffac40f8a985a2b2749244b8a1c4161?d=identicon&s=25 Mike Stok (Guest)
on 2006-06-11 00:28
(Received via mailing list)
On 10-Jun-06, at 5:48 PM, Robert MannI wrote:

> Hello!
>
> Maybe someone here knows how to do this:
>
> I have some Ruby code, and I need it in a syntax colored HTML
> output format.
>
> Is there any easy way to do this, maybe the "ruby" binary can do this?

If you have vim then this:

  vim -f +"syn on" +"run! syntax/2html.vim" +"wq" +"q" file.rb

should generate file.rb.html

Hope this helps,

Mike

--

Mike Stok <mike@stok.ca>
http://www.stok.ca/~mike/

The "`Stok' disclaimers" apply.
6076c22b65b36f5d75c30bdcfb2fda85?d=identicon&s=25 Ezra Zygmuntowicz (Guest)
on 2006-06-11 00:34
(Received via mailing list)
On Jun 10, 2006, at 2:48 PM, Robert MannI wrote:

> Thanks alot,
> Rob


Hey Robert-

	There are two gems that are available that will produce colorized
html out of ruby code.

http://coderay.rubychan.de/
gem install coderay

AND

http://syntax.rubyforge.org/
gem install syntax


Cheers-
-Ezra
C31c7255fa4488dfc5d766403b497a36?d=identicon&s=25 Jim Morris (wolfmanjm)
on 2006-06-11 09:28
(Received via mailing list)
I have a blog entry on how I did this...

http://blog.wolfman.com/articles/2006/05/26/howto-...
9618e8fca8d72bf01814276c53c2568c?d=identicon&s=25 Robert MannI (Guest)
on 2006-06-11 11:33
(Received via mailing list)
Thanks alot for all the tips :)
428f96cc689eb7419bba3a8bbfcc222a?d=identicon&s=25 Stefan Mahlitz (Guest)
on 2006-06-11 20:03
(Received via mailing list)
Robert MannI wrote:
> Hello!
>
> Maybe someone here knows how to do this:
>
> I have some Ruby code, and I need it in a syntax colored HTML output
> format.

SciTE is able to export the current file into RTF, HTML, XML and some
others.

Stefan
This topic is locked and can not be replied to.