Hi there, I'm looking for a tool that can highlight code (ruby, php, javascript...) like with an IDE and then export the code to html format so that when opening the html page the code looks just like with the IDE
Thanks.
Hi there, I'm looking for a tool that can highlight code (ruby, php, javascript...) like with an IDE and then export the code to html format so that when opening the html page the code looks just like with the IDE
Thanks.
To be independent of editors, you can simply use the ruby syntax gem. Here is an excerpt of the user guide, which shows the feature you are looking for:
require 'syntax/convertors/html'
convertor = Syntax::Convertors::HTML.for_syntax "ruby"
html = convertor.convert( File.read( "program.rb" ) )
puts html
Emacs supports exporting code to html using http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el
You can also use code2html (project page) to color source code.
code2html file.c > code.html
Textmate can do it too. See "Create HTML From Document" in the TextMate bundle.