[ANN] Ruby Code & Style

The newest on-line resource for serious Ruby information has gone live.

Ruby Code & Style[0], an on-line magazine from Artima, has just published issue #1.

Check out the names on the advisory board. It's pretty much a Who's Who of everybody who's anybody in the Ruby world.

The premiere issue has three outstanding articles:

First up, Jack Herrington, author of Code Generation in Action (Manning, 2002) and Podcasting Hacks (O'Reilly, 2005), has written "Modular Architectures with Ruby."

Next, Austin Ziegler gives us "Creating Printable Documents with Ruby."

And there's a reprint of Ara Howard's article, "Linux Clustering with Ruby Queue: Small is Beautiful", which first appeared in Linux Journal but deserves repeat attention.

A big thanks to the advisory board, and especially to Bill Venners for starting this whole thing.

[0] http://www.artima.com/rubycs/index.html

James Britt
Editor-in-Chief, Ruby Code & Style

PS: Writers wanted. We're looking for experienced Rubyists to write articles covering the sort of hard-core technical stuff that's currently hard to find.

Contact me at james DOT britt AT gmail DOT com or track me down at RubyConf 2005 (see the Ruby Garden face-book page)

http://www.rubygarden.org/ruby?RubyConf2005Facebook#JamesBritt

···

--

http://www.ruby-doc.org - The Ruby Documentation Site
http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys

James Britt ha scritto:

The newest on-line resource for serious Ruby information has gone live.

Ruby Code & Style[0], an on-line magazine from Artima, has just published issue #1.

<snipall>

well, congratulations, can't wait to read the next issue :slight_smile:

I've read, and enjoyed, the first article.

Requests:

1. Could the code font size be increased a bit?
2. Any chance of syntax highlighting?

Thanks!

James Edward Gray II

···

On Oct 9, 2005, at 11:52 PM, James Britt wrote:

The newest on-line resource for serious Ruby information has gone live.

Thanks! Good Stuff!

I have printed each article courtesy of the "print" links, and place them as reading matter and gentle Ruby advocacy in the coffee room.

One suggestion for the next issue though...

Could you make a "print the entire magazine" link?

It would be a "nice to have" to be able to print something like
  http://www.tuxmagazine.com/

I always print the cover of Tuxmagazine in colour and put a full copy in the coffee room. (Ps: I'm not enamoured with Tuxmag's landscape format. :-))

Perhaps commission "Why the lucky stiff" to do a cover...

John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : john.carter@tait.co.nz
New Zealand

Carter's Clarification of Murphy's Law.

"Things only ever go right so that they may go more spectacularly wrong later."

From this principle, all of life and physics may be deduced.

···

On Mon, 10 Oct 2005, James Britt wrote:

The newest on-line resource for serious Ruby information has gone live.

Ruby Code & Style[0], an on-line magazine from Artima, has just published issue #1.

James Edward Gray II wrote:

The newest on-line resource for serious Ruby information has gone live.

I've read, and enjoyed, the first article.

Requests:

1. Could the code font size be increased a bit?

CTRL +

:slight_smile:

I imagine alternate stylesheets could be added to supply for larger fonts. But the site is generated by an semi-automated publishing process, so I don't know offhand how that would be added or who would be responsible.

(There's always mousehole and/or greasemonkey, for the more ambitious out there.)

2. Any chance of syntax highlighting?

Man, some people want everything!

Indeed, syntax highlighting would be nice. Are there existing Ruby apps that will take a source file and generate nice colored HTML? (I bet there are; I'm too lazy/busy (blazy?) to look.)

The articles are published by a Java app (I think; might only be driven by a JSP but not processed by it) that reads a source article marked up in a Artima-publishing variant of HTML.

*Perhaps*, if anyone wants to take a shot, the markup could be pre-processed by a Ruby app that applies syntax coloring only to code within <pre class='indent'></pre> or <code></code> sections.

It may be possible to also toss in a marker class attribute value:
<pre class='indent ruby'>, or <pre class='indent java'> so that different code gets different syntax treatment.

(Is there a better way to indicate that some element contains preformatted code for a particular programming language?)

James

···

On Oct 9, 2005, at 11:52 PM, James Britt wrote:

--

http://www.ruby-doc.org - The Ruby Documentation Site
http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys

John Carter wrote:

The newest on-line resource for serious Ruby information has gone live.

Ruby Code & Style[0], an on-line magazine from Artima, has just published issue #1.

Thanks! Good Stuff!

I have printed each article courtesy of the "print" links, and place them as reading matter and gentle Ruby advocacy in the coffee room.

One suggestion for the next issue though...

Could you make a "print the entire magazine" link?

Hmm. Given that the first issue has an article on PDF::Writer ...

It would be a "nice to have" to be able to print something like
http://www.tuxmagazine.com/

I always print the cover of Tuxmagazine in colour and put a full copy in the coffee room. (Ps: I'm not enamoured with Tuxmag's landscape format. :-))

Perhaps commission "Why the lucky stiff" to do a cover...

There's thought ...

Hey, Why, get yo' ass to San Diego!

James

···

On Mon, 10 Oct 2005, James Britt wrote:

--

http://www.ruby-doc.org - The Ruby Documentation Site
http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys

James Edward Gray II wrote:

The newest on-line resource for serious Ruby information has gone live.

I've read, and enjoyed, the first article.

Requests:

1. Could the code font size be increased a bit?

CTRL +

:slight_smile:

I imagine alternate stylesheets could be added to supply for larger fonts. But the site is generated by an semi-automated publishing process, so I don't know offhand how that would be added or who would be responsible.

(There's always mousehole and/or greasemonkey, for the more ambitious out there.)

2. Any chance of syntax highlighting?

Man, some people want everything!

Indeed, syntax highlighting would be nice. Are there existing Ruby apps that will take a source file and generate nice colored HTML? (I bet there are; I'm too lazy/busy (blazy?) to look.)

vim does this from the command line. this converts a directory full of ruby
files to syntax highlighted html:

   for f in *.rb;do vim -f +"syn on" +"run! syntax/2html.vim" +"wq" +"q" $f;done

The articles are published by a Java app (I think; might only be driven by a JSP but not processed by it) that reads a source article marked up in a Artima-publishing variant of HTML.

*Perhaps*, if anyone wants to take a shot, the markup could be pre-processed by a Ruby app that applies syntax coloring only to code within <pre class='indent'></pre> or <code></code> sections.

it would be trivial to write a ruby app that scanned to the 'indent' class,
extracted all the next before the matching/closing pre, wrote a tmp file,
converted it to html, and munged the html file in place with marked up ruby
code. let me know if you want me to do it and provide me with a sample html
file unless you think a file save-as from the site will do.

It may be possible to also toss in a marker class attribute value:
<pre class='indent ruby'>, or <pre class='indent java'> so that different code gets different syntax treatment.

the thing with vim is that it will determine the automatically from either the
file extension or the shebang line - no special css needed.

cheers.

-a

···

On Tue, 11 Oct 2005, James Britt wrote:

On Oct 9, 2005, at 11:52 PM, James Britt wrote:

--

email :: ara [dot] t [dot] howard [at] noaa [dot] gov
phone :: 303.497.6469
Your life dwells amoung the causes of death
Like a lamp standing in a strong breeze. --Nagarjuna

===============================================================================

James Edward Gray II wrote:

The newest on-line resource for serious Ruby information has gone live.

I've read, and enjoyed, the first article.

Requests:

1. Could the code font size be increased a bit?

CTRL +

First read that as "me too" then realised it's a Firefox reference.
Firefox does not always do the right things with 3 columns and large
print though, but this site is such that it copes well. I stress tested it with letters an inch high, approx.

For better Firefox support a <link rel="alternate" type="application/rss+xml" title="RSS 2.0"
   href="..."> line in the <head>...</head> would also be good to make the RSS visble to
Firefox's 'magic'.

:slight_smile:

         [...]

2. Any chance of syntax highlighting?

Man, some people want everything!

Indeed, syntax highlighting would be nice. Are there existing Ruby apps that will take a source file and generate nice colored HTML? (I bet there are; I'm too lazy/busy (blazy?) to look.)

(which is highlight). About which I note on my home page:
<quote>
The documentation about this package for hightlighting programming languages is in German followed by English. It is possible to do some of this using Vim,

#!/bin/sh

for f in $*
do
     vim -f +"syn on" +"run! syntax/2html.vim" +"wq" +"q" $f
done

but I have found that since I use light text on a dark background results are disappointing when printing.
</quote>

(Is there a better way to indicate that some element contains preformatted code for a particular programming language?)

Not to my knowledge. Only spoken/written languages AFAIK.

James

         Hugh

···

On Tue, 11 Oct 2005, James Britt wrote:

On Oct 9, 2005, at 11:52 PM, James Britt wrote:

Heck, with a bit of work, someone could do a variation on Syntax Colorer to get automatic client-side ruby syntax highlighting :slight_smile:

(The downside is that it's client-side and requires JS. The upside is that it no pre-processing step is needed - a human can edit the pure ruby code inside the block at any time, in any place, and have it syntax colored. View source of the page to see the cleanliness.)

···

On Oct 10, 2005, at 10:23 AM, James Britt wrote:

*Perhaps*, if anyone wants to take a shot, the markup could be pre-processed by a Ruby app that applies syntax coloring only to code within <pre class='indent'></pre> or <code></code> sections.

It may be possible to also toss in a marker class attribute value:
<pre class='indent ruby'>, or <pre class='indent java'> so that different code gets different syntax treatment.

Ara.T.Howard wrote:
..

Indeed, syntax highlighting would be nice. Are there existing Ruby apps that will take a source file and generate nice colored HTML? (I bet there are; I'm too lazy/busy (blazy?) to look.)

vim does this from the command line. this converts a directory full of ruby
files to syntax highlighted html:

  for f in *.rb;do vim -f +"syn on" +"run! syntax/2html.vim" +"wq" +"q" $f;done

Ah so! See, vim has *everything* !
...

*Perhaps*, if anyone wants to take a shot, the markup could be pre-processed by a Ruby app that applies syntax coloring only to code within <pre class='indent'></pre> or <code></code> sections.

it would be trivial to write a ruby app that scanned to the 'indent' class,
extracted all the next before the matching/closing pre, wrote a tmp file,
converted it to html, and munged the html file in place with marked up ruby
code. let me know if you want me to do it and provide me with a sample html
file unless you think a file save-as from the site will do.

I'll send you a sample file. Yours, actually, from RC&S, after the markup had been applied.

It may be possible to also toss in a marker class attribute value:
<pre class='indent ruby'>, or <pre class='indent java'> so that different code gets different syntax treatment.

the thing with vim is that it will determine the automatically from either the
file extension or the shebang line - no special css needed.

Except that a single ArtimaML file might have source code for multiple different languages.

James

···

On Tue, 11 Oct 2005, James Britt wrote:

--

http://www.ruby-doc.org - The Ruby Documentation Site
http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys

2. Any chance of syntax highlighting?

There is also the syntax gem that does great ruby highlighting in html.

Cheers-
-Ezra Zygmuntowicz
Yakima Herald-Republic
WebMaster

509-577-7732
ezra@yakima-herald.com