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
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
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.
gem install syntax
require ‘syntax’
require ‘syntax/convertors/html’
def ruby_to_html(script_str)
convertor = Syntax::Convertors::HTML.for_syntax(‘ruby’)
return %(
Hope it helps,
Obie
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.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs