From: "Ara.T.Howard" Date: 2005-10-11T01:46:55+09:00 Subject: Re: [ANN] Ruby Code & Style On Tue, 11 Oct 2005, James Britt wrote: > James Edward Gray II wrote: >> On Oct 9, 2005, at 11:52 PM, James Britt 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 + > > :) > > 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
 class='indent'>
or 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: >
, or 
 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
===============================================================================