Over a million developers have joined DZone.

Syntax Highlighting With Enscript

·

enscript --color --language=html -Eruby --output=dest.html file.rb


You may need to obtain ruby.st for Ruby syntax highlighting:


$ cd /usr/share/enscript/hl
$ sudo curl -O http://java.thn.htu.se/~toor/blog-ng/wp-content/ruby.st


Like any good UNIX program, you can also use pipes:


$ find . -name '*.rb' | xargs cat | enscript --color --language=html -Eruby --output=-

Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}