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

09.25.2005
| 9752 views |
  • submit to reddit
        
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

Snippets Manager replied on Wed, 2006/09/06 - 8:45pm

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.