Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I work in bash/xterm a lot, and do a lot of filtering of HTML. What I was wondering is if there is a simple way to highlight html to stdout?

Something like:

$ cat file.html | [some html highlighting utility]

Would output syntax colored HTML to standard out, assuming $TERM is xterm-color or xterm-256color.

Is there anything like that out there?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Yes and it's called highlight, I used to run highlight -q -s vim-dark -M file (-M means --xterm256)

There is another option, Pygments if you are Python fan, you will like it. You can just run pygmentize example.html.

share|improve this answer
    
Pygments works perfectly. Thanks! –  rossipedia Jun 29 '10 at 16:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.