devxlogo

Pretty Print Your HTML and ASP Code for Visitors

Pretty Print Your HTML and ASP Code for Visitors

If you are preparing Active Server Pages code for printing or for code review it helps to make the script as tidy as possible. A free utility called HTML Tidy from http://www.w3.org/People/Raggett/tidy/ does an excellent job of putting HTML in order. Unfortunately, Tidy doesn’t preserve ASP code. For example, it converts ASP delimiters into HTML escape codes so that HTML Tidy runs from the command prompt. Here’s the contents of a batch file called dotidy.bat:

 tidy -i -m -u -raw -f  errors.txt -wrap 200 %1

Call the batch file by passing the filename to it as in:

 dotidy.bat myfile.asp

I’ve asked the author of HTML Tidy to add a switch that protects ASP code. Perhaps additional requests at his Web page will provide an incentive.

devx-admin

Share the Post: