[ANN] Ruby Code & Style

J

James Britt

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
 
G

gabriele renzi

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 :)
 
J

James Edward Gray II

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?
2. Any chance of syntax highlighting?

Thanks!

James Edward Gray II
 
J

James Britt

James said:
I've read, and enjoyed, the first article.

Requests:

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

CTRL +

:)

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

--

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
 
A

Ara.T.Howard

CTRL +

:)

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


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

James Britt

Ara.T.Howard said:
On Tue, 11 Oct 2005, James Britt wrote: ..



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* !
...
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.
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

--

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
 
H

Hugh Sasse


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="...">
:)
[...]
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.)

http://www.andre-simon.de/
(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.
(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.
Hugh
 
J

John Carter

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?

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 : (e-mail address removed)
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.
 
J

James Britt

John said:
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

--

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
 
E

Ezra Zygmuntowicz

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

Cheers-
-Ezra Zygmuntowicz
Yakima Herald-Republic
WebMaster
http://yakimaherald.com
509-577-7732
(e-mail address removed)
 
G

Gavin Kistner

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

Heck, with a bit of work, someone could do a variation on http://
phrogz.net/JS/Classes/syntaxcolor_test.html to get automatic client-
side ruby syntax highlighting :)

(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.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top