It''s even easier than that in Typo. I''m running 2.5.5, and
this is what I
add:
<typo:code lang="ruby">
</typo:code>
If you click on the ''filters'' tab in the admin pages,
you''ll see what code
filters you''ve got installed. Also, the theme CSS needs to have the
correct
entries for the typocode classes - the built in azure theme does, the orange
theme does not.
-----Original Message-----
From: Obie Fernandez
[mailto:obiefernandez-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org]
Sent: Sunday, November 13, 2005 4:24 PM
To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Subject: Re: [Rails] Color syntax for ruby code in Typo
It''s so easy to do color syntax formatting with the syntax gem. I
recently added this feature to the app on working on so here''s my 4
steps.
1) install the gem...
gem install syntax
2) Add the following require statements to the environment.rb file of
your Rails app:
require ''syntax''
require ''syntax/convertors/html''
3) Write yourself a helper method that does the conversion and
conveniently wraps the resulting html in a div, for example...
def ruby_to_html(script_str)
convertor = Syntax::Convertors::HTML.for_syntax(''ruby'')
return %(<div
class="ruby">#{convertor.convert(script_str)}</div>)
end
4) Include a copy of ruby syntax css file in your application, for
example http://syntax.rubyforge.org/stylesheets/ruby.css
Hope it helps,
Obie
On 11/13/05, Jaroslaw Zabiello
<hipertracker-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Do you know how get color syntax for Ruby code snippets in Typo? It is
> possible, but I do not know how:
> http://scottstuff.net/blog/articles/tag/
>
> Is it possible for Typo to get color syntax for other languages,
> Python, PHP, etc?
>
> --
> JZ
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails