Never been to DZone Snippets before?

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

Syntax Highlighting with enscript (See related posts)

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=-


Comments on this post

fuelfive posts on Nov 20, 2006 at 19:30
http://java.thn.htu.se/~toor/blog-ng/wp-content/ruby.st looks like it's down. Just using "-ruby" instead of "-Eruby" works, but it doesn't color the syntax at all.

You need to create an account or log in to post comments to this site.


Click here to browse all 4858 code snippets

Related Posts