Topic: Syntax highlighting now available for Ruby and other languages

Try it out:

class Post < ActiveRecord::Base
  validates_uniqueness_of :title

  def validate
    #a comment
  end
end


The syntax is [ code=ruby ] [ /code ] (without the spaces).

The same bbcode syntax works for other languages, like YAML, PHP, CSS, XML, etc. Try some out and see what works/doesn't work smile

vinnie - rails forum admin

Re: Syntax highlighting now available for Ruby and other languages

Beautiful...  Thanks.

My RoR journey  -- thoughts on learning RoR and lessons learned in applying TDD and agile practices.

Re: Syntax highlighting now available for Ruby and other languages

Yep, that's great, Vinnie!

Josh Catone helps run this place
Rails Forum - Rails Jobs

Re: Syntax highlighting now available for Ruby and other languages

Thanks vinnie smile

AJ

Re: Syntax highlighting now available for Ruby and other languages

Yeah, very cool.

We'll have to add this to the rorbb list wink

Re: Syntax highlighting now available for Ruby and other languages

incredible!  Benkster:  Hopefully this PunBB doesn't start to outrun us :-)

Is there any way we can get the code to not wrap when it gets converted to a table and set the table to overflow: scroll ?  I LOVE the markup script you've got but linebreaks are kind of a hassle.

Last edited by danger (2006-06-18 14:26:19)

Re: Syntax highlighting now available for Ruby and other languages

danger wrote:

Is there any way we can get the code to not wrap when it gets converted to a table and set the table to overflow: scroll ?  I LOVE the markup script you've got but linebreaks are kind of a hassle.

I've gotten this working, but it required changing the markup to an ordered list.

vinnie - rails forum admin