html2highlight is a a script that converts an HTML or any other XML-like SGML document into a HTML page showing the document's source code with naïve syntax highlighting. The output document requires a CSS-capable browser.

The colours for the syntax highlighting are inspired by Mozilla's "View Source" function.

Although it is a Perl script, it is reasonably efficient. It typically takes about 1 minute to convert a 100KB document on my 400MHz Pentium Celery with 256MB RAM. Output documents are about 2 to 5 times the size of the original.

Examples

Download

html2highlight 0.01.

Syntax

perl html2highlight.pl http://example.com/example.html > output.html

Requires

Lynx.