Forum: Ruby Syntax highlighting library

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2c7c807a1df0c76a8fc823c709b501a9?d=identicon&s=25 Victor Shepelev (Guest)
on 2006-05-03 18:59
(Received via mailing list)
Hello all.

Does some good subj exists?
If no, maybe it would be useful If I'll port GeShi[1]?

Victor.

1. http://qbnz.com/highlighter/index.php
801b207647d808477fc4514568c9d723?d=identicon&s=25 Dimitri Aivaliotis (Guest)
on 2006-05-03 18:59
(Received via mailing list)
On 5/2/06, Victor Shepelev <vshepelev@imho.com.ua> wrote:
>
>
> Does some good subj exists?
>

Try Syntax <http://rubyforge.org/projects/syntax> or
CodeRay<http://rd.cycnus.de/coderay/>
.

- Dimitri
Cb48ca5059faf7409a5ab3745a964696?d=identicon&s=25 unknown (Guest)
on 2006-05-03 18:59
(Received via mailing list)
On Tue, 2 May 2006, Dimitri Aivaliotis wrote:

> - Dimitri
this simple script will convert any src file, including fortran, c++,
java,
etc, to html:


   harp:~ > cat a.rb

   #!/usr/bin/env ruby
   require 'tempfile'
   $VERBOSE=nil
   STDERR.reopen(Tempfile::new($$)) unless STDIN.tty?

   fin, fout, _ = ARGV
   fin = ((fin.nil? or fin == '-') ? STDIN : open(fin))
   fout = ((fout.nil? or fout == '-') ? STDOUT : open(fout,'w+'))

   ts = Tempfile::new($$), Tempfile::new($$)
   ts[0].write fin.read
   ts.each{|t| t.close}
   command = %Q( vim -f +'syn on' +'set filetype=ruby' +'set
background=light' +'run! syntax/2html.vim' +'w! #{ ts[1].path }' +'qa!'
- < #{ ts[0].path } > /dev/null 2>&1 )
   system command
   ts.each{|t| t.open; t.rewind}
   fout.write(ts[1].read)
   ts.each{|t| t.close!}


the 'set filetype=ruby' functions only as a default.  for instance this

   ruby a.rb src.c src.html

does the right thing.

regards.

-a
2c7c807a1df0c76a8fc823c709b501a9?d=identicon&s=25 Victor Shepelev (Guest)
on 2006-05-03 19:06
(Received via mailing list)
> Dimitri Aivaliotis wrote:
>
> Try Syntax <http://rubyforge.org/projects/syntax> or
> CodeRay<http://rd.cycnus.de/coderay/>

Unfortunally, they noth have very poor base of ready language files and
rather complicated mechanism for defining new ones.

> From: ara.t.howard@noaa.gov [mailto:ara.t.howard@noaa.gov]
>
> this simple script will convert any src file, including fortran, c++,
> java,
> etc, to html:
>
...
>    command = %Q( vim -f +'syn on' +'set filetype=ruby' +'set
> background=light' +'run! syntax/2html.vim' +'w! #{ ts[1].path }' +'qa!' -
> < #{ ts[0].path } > /dev/null 2>&1 )

Not very universal solution. At least requires vim installed (which
seams to
be *very* uncommon on non-Unix systems ;)

V.
This topic is locked and can not be replied to.