Write ruby code on a blog

Hi,

Anyone got any ideas on how to easily write and correctly display
(with syntax highlighting) Ruby code on a blog?

Regards,

Aidy

In the past I've done this using Vim. Vim has a command called
something like TOhtml, which will take the displayed file (such as
ruby code) and generate an html file that displays the code with the
same syntax coloring that Vim itself displays the code in. I've done
this manually by loading the desired file into Vim, executing the
command, then saving the resulting file to an .html file, but I
wouldn't be surprised if there's a way to automate it.

···

On Apr 15, 8:10 am, aidy <aidy.le...@googlemail.com> wrote:

Hi,

Anyone got any ideas on how to easily write and correctly display
(with syntax highlighting) Ruby code on a blog?

You could run it through CodeRay which is a Syntax Highlighter written in Ruby.

http://coderay.rubychan.de/

Greetings
Florian Gilcher

···

On Apr 15, 2008, at 2:15 PM, aidy wrote:

Hi,

Anyone got any ideas on how to easily write and correctly display
(with syntax highlighting) Ruby code on a blog?

Regards,

Aidy

aidy wrote:

Anyone got any ideas on how to easily write and correctly display
(with syntax highlighting) Ruby code on a blog?

I personally use Pygments: http://pygments.org

HTH,
Antonio
- --
http://antoniocangiano.com - Zen and the Art of Programming
http://stacktrace.it - Aperiodico di resistenza informatica
http://math-blog.com - Math Blog: Mathematics is wonderful!

If you use TextMate as your editor, you can convert your code to syntax highlighted HTML using the "Create HTML From Document" command in the "TextMate" bundle.

James Edward Gray II

···

On Apr 15, 2008, at 7:15 AM, aidy wrote:

Anyone got any ideas on how to easily write and correctly display
(with syntax highlighting) Ruby code on a blog?

I missed the original post, but this is what I use for my blog:

http://redcorundum.blogspot.com/2006/07/syntax-coloring.html

--Greg

···

On Wed, Apr 16, 2008 at 01:00:10AM +0900, Karl von Laudermann wrote:

On Apr 15, 8:10 am, aidy <aidy.le...@googlemail.com> wrote:
> Hi,
>
> Anyone got any ideas on how to easily write and correctly display
> (with syntax highlighting) Ruby code on a blog?

In the past I've done this using Vim. Vim has a command called
something like TOhtml, which will take the displayed file (such as
ruby code) and generate an html file that displays the code with the
same syntax coloring that Vim itself displays the code in. I've done
this manually by loading the desired file into Vim, executing the
command, then saving the resulting file to an .html file, but I
wouldn't be surprised if there's a way to automate it.

If you're using wordpress check out wp-syntax, it supports a wide variety of
languages using GeSHI (generic syntax highlighting)

···

On Tue, Apr 15, 2008 at 10:35 PM, Antonio Cangiano <acangiano@gmail.com> wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

aidy wrote:
> Anyone got any ideas on how to easily write and correctly display
> (with syntax highlighting) Ruby code on a blog?

I personally use Pygments: http://pygments.org

HTH,
Antonio
- --
http://antoniocangiano.com - Zen and the Art of Programming
http://stacktrace.it - Aperiodico di resistenza informatica
http://math-blog.com - Math Blog: Mathematics is wonderful!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgFZRsACgkQqCqsu0qUj9RuUACgqI0FGuZ19jaN3ckL0ysGwM32
B2UAoMjTzfNL1diZeQ5OKpG4//PjMNkY
=9Jz+
-----END PGP SIGNATURE-----