[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

write ruby code on a blog

aidy

4/15/2008 12:10:00 PM

Hi,

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

Regards,

Aidy
7 Answers

Karl von Laudermann

4/15/2008 3:59:00 PM

0

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.

Florian Gilcher

4/15/2008 4:14:00 PM

0

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

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

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

Gregory Seidman

4/15/2008 4:58:00 PM

0

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.

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

http://redcorundum.blogspot.com/2006/07/syntax-col...

--Greg


Antonio Cangiano

4/16/2008 2:32:00 AM

0

-----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://py...

HTH,
Antonio
- --
http://antonioca... - Zen and the Art of Programming
http://sta... - Aperiodico di resistenza informatica
http://mat... - Math Blog: Mathematics is wonderful!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail....

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

Zachary Scott

4/16/2008 3:18:00 AM

0

[Note: parts of this message were removed to make it a legal post.]

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/...
http://qbnz.com/hi...

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://py...
>
> HTH,
> Antonio
> - --
> http://antonioca... - Zen and the Art of Programming
> http://sta... - Aperiodico di resistenza informatica
> http://mat... - Math Blog: Mathematics is wonderful!
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.8 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail....
>
> iEYEARECAAYFAkgFZRsACgkQqCqsu0qUj9RuUACgqI0FGuZ19jaN3ckL0ysGwM32
> B2UAoMjTzfNL1diZeQ5OKpG4//PjMNkY
> =9Jz+
> -----END PGP SIGNATURE-----
>
>

James Gray

4/22/2008 2:56:00 PM

0

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

Pete Barrett

1/10/2009 12:04:00 PM

0

On Thu, 08 Jan 2009 15:23:01 -0800, Andre Kantek wrote:

> I believe that is no more likely than Tatcher in 1982, besides France
> was more in turmoil during the 60s.
>
As it turned out, Mrs. Thatcher didn't need to - the war went about as
well as she could have hoped. But British public opinion would have
supported her if she'd deployed them (possibly not if she'd used them) at
the time. (Though the US wouldn't have supported even threatening
Argentina with nuclear weapons, which would probably have been decisive
for Mrs. Thatcher; I doubt de Gaulle would have cared about US opinion 20
years earlier.)

> De Gaulle would prefer a more conventional approach, IMO.

I don't doubt it. However, what I see happening is something like this:

The war drags on, and France suffers a definite reverse.
De Gaulle's popularity plummets among the French electorate.
De Gaulle publicly deploys a single bomber capable of carrying a nuclear
weapon, which is an implied threat.
De Gaulle's popularity increases.
France conducts a nuclear test, just to drive the point home.
De Gaulle's poularity increases further.
Brazil continues the war.
De Gaulle finds that actually using the thing would be politically popular
with the electorate.

Which puts him a real fix.

--
Pete Barrett