DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Syntax Highlighting With Enscript

  • submit to reddit
enscript --color --language=html -Eruby --output=dest.html file.rb

You may need to obtain for Ruby syntax highlighting:

$ cd /usr/share/enscript/hl
$ sudo curl -O

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

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


Snippets Manager replied on Wed, 2006/09/06 - 7:45pm looks like it's down. Just using "-ruby" instead of "-Eruby" works, but it doesn't color the syntax at all.