portfolio rubyonrails

Syntax Highlight on Rails

Quer fazer um syntax highlight igual ao do codestacker abaixo, a la Textmate? É fácil:

Faça o download da biblioteca de expressões regulares Oniguruma. A versão mais recente é a 5.9.1. Compile-a:

./configure && make && make install

Após isso instale as gems Oniguruma, Textpow e Ultraviolet e instale o plugin tm_syntax_highlighting em seu projeto.

Em suas views, utilize:

code(some_ruby_code, :theme => "twilight", :lang => "ruby", :line_numbers => true)
Avatar photo If you like my content, follow me on Twitter and GitHub TwitterTweet

Interactions

Webmentions

Comments

comments powered by Disqus