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

On Apr 15, 8:10 am, aidy [email protected] 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.

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

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

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

http://coderay.rubychan.de/

Greetings
Florian G.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkgE1BgACgkQJA/zY0IIRZZMQQCfeyjAQ1Nk73RRX+HQQmIv6PSL
usoAoMvtjPspjndfWps2mPbaa8NkalDA
=WhB6
-----END PGP SIGNATURE-----

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

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.

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

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

–Greg

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

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?

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

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

http://wordpress.org/extend/plugins/wp-syntax/
http://qbnz.com/highlighter/

On Tue, Apr 15, 2008 at 10:35 PM, Antonio C. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs