[header] categories=Basic Options cfgFileParameterEnding=cr configFilename= fileTypes=*.htm|*.html|*.xhtml|*.xml|*.xlst indenterFileName=htb indenterName=HTB (HTML, XML, XSL) inputFileName=indentinput inputFileParameter= manual=http://www.digital-mines.com/htb/htb_docs.html outputFileName=indentoutput outputFileParameter= parameterOrder=pio showHelpParameter=-h stringparaminquotes=false useCfgFileParameter= version=2.0 [Multi-Attribute Tag Break] Category=0 Description="

The -a command-line option causes all tags containing more that one attribute to be broken over multiple lines, each with a single attribute. The attributes are aligned vertically with the first attribute. A similar attribute break will occur by default, but only on tags exceeding the column 80 limit, and each line may contain more than one attribute.

Before:

<BODY BGCOLOR="#FFFFFF" MARGINWIDTH="0" MARGINHEIGHT="0" LINK="#666666" VLINK="#666666" ALINK="#000000">\n<TABLE WIDTH="800" BORDER="0" CELLPADDING="0" CELLSPACING="0">\n<TR>\n<TD COLSPAN="2" WIDTH="196" BGCOLOR="cccccc" VALIGN="top"><IMG SRC="/images/homepage/rev/logo_06.gif" WIDTH="196" HEIGHT="63"></TD>\n<TD BGCOLOR="cccccc" WIDTH="600" VALIGN="top">\n<TABLE WIDTH="600" BORDER="0" CELLPADDING="0" CELLSPACING="0" VALIGN="top">\n<TR>\n<TD VALIGN="top" HEIGHT="17" BGCOLOR="#CCCCCC"><IMG SRC="/images/homepage/rev/comp8_07.gif" WIDTH="600" HEIGHT="17"></TD>\n</TR>
After:
<BODY ALINK="#000000"\n      BGCOLOR="#FFFFFF"\n      LINK="#666666"\n      MARGINHEIGHT="0"\n      MARGINWIDTH="0"\n      VLINK="#666666">\n<TABLE BORDER="0"\n       CELLPADDING="0"\n       CELLSPACING="0"\n       WIDTH="800">\n   <TR>\n      <TD BGCOLOR="cccccc"\n          COLSPAN="2"\n          VALIGN="top"\n          WIDTH="196"><IMG HEIGHT="63"\n                           SRC="/images/homepage/rev/logo_06.gif"\n                           WIDTH="196"></TD>\n      <TD BGCOLOR="cccccc"\n          VALIGN="top"\n          WIDTH="600"> \n         <TABLE BORDER="0"\n                CELLPADDING="0"\n                CELLSPACING="0"\n                VALIGN="top"\n                WIDTH="600">\n            <TR>\n               <TD BGCOLOR="#CCCCCC"\n                   HEIGHT="17"\n                   VALIGN="top"><IMG HEIGHT="17"\n                                    SRC="/images/homepage/rev/comp8_07.gif"\n                                    WIDTH="600"></TD>\n            </TR>
" EditorType=boolean TrueFalse=-a| ValueDefault=0 [All Attribute Tag Break] Category=0 Description="

The -b command-line option causes all tag attributes to be broken on succeeding lines. The attributes are aligned vertically with the last character in the tag name.

Before:

<BODY BGCOLOR="#FFFFFF" MARGINWIDTH="0" MARGINHEIGHT="0" LINK="#666666" VLINK="#666666" ALINK="#000000">\n<TABLE WIDTH="800" BORDER="0" CELLPADDING="0" CELLSPACING="0">\n<TR>\n<TD COLSPAN="2" WIDTH="196" BGCOLOR="cccccc" VALIGN="top"><IMG SRC="/images/homepage/rev/logo_06.gif" WIDTH="196" HEIGHT="63"></TD>\n<TD BGCOLOR="cccccc" WIDTH="600" VALIGN="top">\n<TABLE WIDTH="600" BORDER="0" CELLPADDING="0" CELLSPACING="0" VALIGN="top">\n<TR>\n<TD VALIGN="top" HEIGHT="17" BGCOLOR="#CCCCCC"><IMG SRC="/images/homepage/rev/comp8_07.gif" WIDTH="600" HEIGHT="17"></TD>\n</TR>
After:
<BODY\n    ALINK="#000000"\n    BGCOLOR="#FFFFFF"\n    BOTMARGIN="0"\n    MARGINHEIGHT="0"\n    MARGINWIDTH="0"\n    LEFTMARGIN="0"\n    LINK="#666666"\n    TOPMARGIN="0"\n    VLINK="#666666">\n<TABLE\n     BORDER="0"\n     CELLPADDING="0"\n     CELLSPACING="0"\n     WIDTH="800">\n   <TR>\n      <TD\n        BGCOLOR="cccccc"\n        COLSPAN="2"\n        VALIGN="top"\n        WIDTH="196"><IMG\n                       HEIGHT="63"\n                       SRC="/images/homepage/rev/logo_06.gif"\n                       WIDTH="196"></TD>\n      <TD\n        BGCOLOR="cccccc"\n        VALIGN="top"\n        WIDTH="600"> \n         <TABLE\n              BORDER="0"\n              VALIGN="top"\n              CELLPADDING="0"\n              CELLSPACING="0"\n              WIDTH="600">\n            <TR>\n               <TD\n                 BGCOLOR="#CCCCCC"\n                 HEIGHT="17"\n                 VALIGN="top"><IMG\n                                HEIGHT="17"\n                                SRC="/images/homepage/rev/comp8_07.gif"\n                                WIDTH="600"></TD>\n            </TR>\n
" EditorType=boolean TrueFalse=-b| ValueDefault=0 [Add Carriage Returns] Category=0 Description="The -c command-line option adds an extra carriage return character to each output line of reformatted data. This allows Unix versions of HTB to create a DOS/Windows compatible text files directly." EditorType=boolean TrueFalse=-c| ValueDefault=0 [Omit Carriage Returns] Category=0 Description="The -d command-line option inhibits extra carriage return character output even if present in the source data. This allows the Windows version of HTB to create a Unix compatible text file directly. This is the default behavior and correctly creates a natively compatible format whether Unix or Windows." EditorType=boolean TrueFalse=-d| ValueDefault=0 [Escaped Tag Conversion] Category=0 Description="The -e command-line option replaces the special markup characters '<', '>', and '&' with escape strings '<', '>', and '&' respectively. Also, the tag sequence '
' is added to the beginning of the output data and the sequence '
' is appended to the end of the data. This creates an entirely new HTML document, which when viewed with a Web Browser, will appear as source instead of normal rendering. This is useful in creating markup tag documentation and is the mechanism used to create the examples in this document. Use in combination with the -k option to do the conversion without applying other reformatting options." EditorType=boolean TrueFalse=-e| ValueDefault=0 [Join Lines - Compress Output] Category=0 Description="The -j command-line option removes all unnecessary whitespace & comments and joins the output lines together whenever possible. The result is totally 'unbeautified' output, but the size will be reduced from 10-40% for quicker transfer over the network. Use this option whenever performance is more important than readability." EditorType=boolean TrueFalse=-j| ValueDefault=0 [Keep Layout - Case Changes Only] Category=0 Description="

When the current indenting and appearance of your tagged document is acceptable, the -k command-line option may be used to change only the case of the tag names and attributes with no other changes applied.

Example:

- Keep the current layout of an HTML document, but change the tag attribute names to lower case (-m option, opposite of tag name case which by default is upper)...

htb -km myfile.html

Before:
<FORM ENCTYPE="multipart/form-data" NAME="coreform" METHOD="POST">\n<INPUT TYPE="submit" VALUE="Submit Request"> \n<INPUT NAME="cgi" TYPE="button" VALUE="cgi2xml">cgi2xml \n<TABLE BORDER="5" CELLPADDING="5">\n   <TR>\n      <TD> <FONT COLOR="purple"> \n         <H4>Output formatting:</H4> </FONT>Debug: \n         <INPUT NAME="debug"><BR> \n         <BR> Filter: \n         <INPUT NAME="filter"><BR> Output: \n         <INPUT NAME="output"><BR> \n         <BR> Pagestart: \n         <INPUT SIZE="4" NAME="pagestart"><BR> Pagesize: \n         <INPUT SIZE="4" NAME="pagesize"><BR> \n      </TD>\n   </TR>\n</TABLE>\n</FORM>
After:
<FORM enctype="multipart/form-data" name="coreform" method="POST">\n<INPUT type="submit" value="Submit Request"> \n<INPUT name="cgi" type="button" value="cgi2xml">cgi2xml \n<TABLE border="5" cellpadding="5">\n   <TR>\n      <TD> <FONT color="purple"> \n         <H4>Output formatting:</H4> </FONT>Debug: \n         <INPUT name="debug"><BR> \n         <BR> Filter: \n         <INPUT name="filter"><BR> Output: \n         <INPUT name="output"><BR> \n         <BR> Pagestart: \n         <INPUT size="4" name="pagestart"><BR> Pagesize: \n         <INPUT size="4" name="pagesize"><BR> \n      </TD>\n   </TR>\n</TABLE>\n</FORM>
" EditorType=boolean TrueFalse=-k| ValueDefault=0 [Tag Names Lower Case] Category=0 Description="

The -l command-line option changes all HTML tag names and their attributes to lower case. Combine with the -m (mixed case) option to keep the tag names lower case, but make the attribute names upper case.

Before:

<FORM ENCTYPE="multipart/form-data" NAME="coreform" METHOD="POST">\n<INPUT TYPE="submit" VALUE="Submit Request"> \n<INPUT NAME="cgi" TYPE="button" VALUE="cgi2xml">cgi2xml \n<TABLE BORDER="5" CELLPADDING="5">\n   <TR>\n      <TD> <FONT COLOR="purple"> \n         <H4>Output formatting:</H4> </FONT>Debug: \n         <INPUT NAME="debug"><BR> \n         <BR> Filter: \n         <INPUT NAME="filter"><BR> Output: \n         <INPUT NAME="output"><BR> \n         <BR> Pagestart: \n         <INPUT SIZE="4" NAME="pagestart"><BR> Pagesize: \n         <INPUT SIZE="4" NAME="pagesize"><BR> \n      </TD>\n   </TR>\n</TABLE>\n</FORM>
After:
<form enctype="multipart/form-data" method="post" name="coreform">\n<input type="submit" value="Submit Request"> \n<input name="cgi" type="button" value="cgi2xml">cgi2xml \n<table border="5" cellpadding="5">\n   <tr>\n      <td> <font color="purple"> \n         <h4>Output formatting:</h4> </font>Debug: \n         <input name="debug"><br> \n         <br> Filter: \n         <input name="filter"><br> Output: \n         <input name="output"><br> \n         <br> Pagestart: \n         <input name="pagestart" size="4"><br> Pagesize: \n         <input name="pagesize size="4"><br> \n      </td>\n   </tr>\n</table>\n</form>\n
" EditorType=boolean TrueFalse=-l| ValueDefault=0 [Tag Attributes Opposite Case] Category=0 Description="The -m command-line option makes the tag attribute case the opposite of the tag name. Since the HTB default is to make tag names upper case, the addition of this option will make the tag attributes lower case. If combined with the -l option (lower case) the tag names will be lower case, and the tag attributes will be upper case. See the -k option for an example." EditorType=boolean TrueFalse=-m| ValueDefault=0 [Never Break Tags Between Lines] Category=0 Description="The -n command-line option cancels the default behavior of breaking tags which exceed the 80 column limit and keeps tags intact within a single line of output regardless of their length. This is often desirable, especially on XSL files." EditorType=boolean TrueFalse=-n| ValueDefault=0 [Remove Non-HTML Tags] Category=0 Description="

The -r command-line option strips any tag which is not part of the HTML 4.01 specification (and a group of widely recognized, commonly used legacy tags) from the output. Its a convenient way to separate HTML from hybrid files like ASP, JSP, XSL or files containing custom tags. The stripped tags are reported along with any errors to "standard error".

Example:

- Remove all non-HTML tags from an XSL/XHTML file...

htb -r myfile.xsl

Before:
\n   <xsl:for-each select="ELEMENT/NODE1"> \n      <xsl:variable select="position()-1" name="vpos" /> \n      <TR VALIGN="top">\n         <TD ALIGN="center"><FONT SIZE="1" FACE="Helvetica"><xsl:value-of select="$vpos" /></FONT> \n         </TD>\n         <TD ALIGN="center"><FONT FACE="Helvetica"> \n            <INPUT NAME="ELEM{$vpos}" TYPE="text" VALUE="Element {$vpos}" /></FONT> \n         </TD>\n         <TD ALIGN="center"><FONT FACE="Helvetica"> \n            <INPUT NAME="NUMB{$vpos}" TYPE="text" VALUE="2" /></FONT> \n         </TD>\n         <TD ALIGN="center"><FONT FACE="Helvetica"> \n            <xsl:variable select="count(//NODE1[@id &gt; -1)" name="pcnt" /> \n            <xsl:variable name="selsize"> \n               <xsl:choose><xsl:when test="$pcnt &lt; 5"> \n                  <xsl:value-of select="$pcnt" /> \n               </xsl:when><xsl:otherwise> \n                  <xsl:value-of select="'5'" /> \n               </xsl:otherwise></xsl:choose> \n            </xsl:variable> \n            <SELECT SIZE="{$selsize}" NAME="VALU{$vpos}">\n               <xsl:for-each select="//VALUE[@id &gt; -1]"> \n                  <OPTION VALUE="{@id}">\n                  <xsl:value-of select="NAME" /></OPTION> \n               </xsl:for-each> \n            </SELECT></FONT> \n         </TD>\n      </TR>\n   </xsl:for-each>
After:
\n   <TR VALIGN="top">\n      <TD ALIGN="center"><FONT FACE="Helvetica" SIZE="1"></FONT> \n      </TD>\n      <TD ALIGN="center"><FONT FACE="Helvetica"> \n         <INPUT NAME="ELEM{$vpos}" TYPE="text" VALUE="Element {$vpos}" /></FONT> \n      </TD>\n      <TD ALIGN="center"><FONT FACE="Helvetica"> \n         <INPUT NAME="NUMB{$vpos}" TYPE="text" VALUE="2" /></FONT> \n      </TD>\n      <TD ALIGN="center"><FONT FACE="Helvetica"> \n         <SELECT NAME="VALU{$vpos}" SIZE="{$selsize}">\n            <OPTION VALUE="{@id}"></OPTION>\n         </SELECT></FONT> \n      </TD>\n   </TR>
" EditorType=boolean TrueFalse=-r| ValueDefault=0 [Remove Tabs from SCRIPTs] Category=0 Description="HTB automatically removes any tab characters found in the source document during the indenting process, but by default SCRIPTs are kept intact. To completely remove all tabs, specify the -s option and tab characters found within SCRIPT elements will be replaced with sets if of indented spaces. This could make the indented script statements look slightly worse and may require minor editing, but the beautified output is clear of any tab characters." EditorType=boolean TrueFalse=-r| ValueDefault=0 [Convert to Plain Text] Category=0 Description="The -t command-line option strips all markup tags, comments and converts the input to plain text. All ASCII and ISO8859-1 HTML escape strings are converted back to the characters they represent. An attempt is made to compress extra whitespace, but in general the text will require additional re-formatting to be made presentable. Use this option to isolate the textual content within tagged documents (not necessarily HTML) for use in other documentation." EditorType=boolean TrueFalse=-t| ValueDefault=0 [Tag Names Upper Case] Category=0 Description="

The -u command-line option changes all HTML tag names and their attributes to upper case. Since this is the default behavior of HTB, it is not required. Use the -m (mixed case) option to keep the tag names upper case, but make the attribute names lower case.

Before:

<form enctype="multipart/form-data" name="coreform" method="POST">\n<input type="submit" value="Submit Request"> \n<input name="cgi" type="button" value="cgi2xml">cgi2xml \n<table border="5" cellpadding="5">\n   <tr>\n      <td> <font color="purple"> \n         <h4>Output formatting:</h4> </font>Debug: \n         <input name="debug"><br> \n         <br> Filter: \n         <input name="filter"><br> Output: \n         <input name="output"><br> \n         <br> Pagestart: \n         <input size="4" name="pagestart"><br> Pagesize: \n         <input size="4" name="pagesize"><br> \n      </td>\n   </tr>\n</table>\n</form>
After:
<FORM ENCTYPE="multipart/form-data" METHOD="POST" NAME="coreform">\n<INPUT TYPE="submit" VALUE="Submit Request"> \n<INPUT NAME="cgi" TYPE="button" VALUE="cgi2xml">cgi2xml \n<TABLE BORDER="5" CELLPADDING="5">\n   <TR>\n      <TD> <FONT COLOR="purple"> \n         <H4>Output formatting:</H4> </FONT>Debug: \n         <INPUT NAME="debug"><BR> \n         <BR> Filter: \n         <INPUT NAME="filter"><BR> Output: \n         <INPUT NAME="output"><BR> \n         <BR> Pagestart: \n         <INPUT NAME="pagestart" SIZE="4"><BR> Pagesize: \n         <INPUT NAME="pagesize" SIZE="4"><BR> \n      </TD>\n   </TR>\n</TABLE>\n</FORM>
" EditorType=boolean TrueFalse=-u| ValueDefault=0 [Unknown Tags are XML] Category=0 Description="

HTB automatically detects XML compliant files and is able to apply reformatting to unknown tags since they meet the predictable behavior of the XML specification. If the input document is not strictly XML compliant, but does contain custom tagging which may be considered "well-formed" XML, the -x option may be used to apply XML handling on these otherwise ignored tags. If XML is detected, either automatically, or with the -x option, the tag case is NOT changed for these non-HTML tags, since they are often case-sensitive. Also, the attributes of unknown tags will remain in original order instead of being sorted as with HTML attributes. To turn off XML auto-detection and apply case changes and attribute sorting to all tags known and unknown, use the -y option.

Example:

- Make tag names and attributes lower case, never break tags, and treat unknown tags in an HTML file as well formed XML...

htb -lnx myfile.html

Before:
<TR><TD WIDTH=182 ALIGN=left BGCOLOR="#ffffff">\n<NYT_HEADLINE>\n<A\n\nHREF="/onthisday/20020619.html"><FONT SIZE="3" FACE="times"><B>On June 19 ...<BR></B></FONT></A>\n</NYT_HEADLINE>\n<NYT_BYLINE>\n<FONT SIZE="-1"></FONT>\n</NYT_BYLINE>\n<NYT_SUMMARY>\n<FONT SIZE="-1">\n<B>1964:</B> The Civil Rights Act of 1964 was approved.   (<A \nHREF="/onthisday/big/0619.html">See this front page.</A>) <BR>\n<B>1903:</B> Lou Gehrig was born.  <A \nHREF="/onthisday/bday/0619.html">(Read about his life.)</A> <BR>\n<B>1886:</B> Harper's Weekly featured a cartoon about the proposed annexation of Nova Scotia. <A \nHREF="/onthisday/harp/0619.html">(See the cartoon.)</A></FONT>\n</TD></TR>
After:
<tr>\n   <td align="left" bgcolor="#ffffff" width="182"> \n      <NYT_HEADLINE> \n         <a href="/onthisday/20020619.html"><font face="times" size="3"><b>On June 19 ...<br></b></font></a> \n      </NYT_HEADLINE> \n      <NYT_BYLINE> <font size="-1"></font> \n      </NYT_BYLINE> \n      <NYT_SUMMARY> <font size="-1"> <b>1964:</b> The Civil Rights Act of 1964 was approved. (<a href="/onthisday/big/0619.html">See this front page.</a>) \n         <br> <b>1903:</b> Lou Gehrig was born. \n         <a href="/onthisday/bday/0619.html">(Read about his life.)</a> \n         <br> <b>1886:</b> Harper's Weekly featured a cartoon about the proposed annexation of Nova Scotia. \n         <a href="/onthisday/harp/0619.html">(See the cartoon.)</a></font> \n   </td>\n</tr>
" EditorType=boolean TrueFalse=-x| ValueDefault=0 [Turn off XML detection] Category=0 Description="

HTB automatically detects XML compliant files and treats the unknown tags differently than HTML tags. XML tags are indented as whitespace permits and case changes & attribute sorting are not applied. To turn off this default behavior and apply case changes & sorting to all tags known and unknown, specify the -y option.

Example:

- Never break tags, make all tags lower case whether HTML or not, and do not change indenting for unknown tags...

htb -lny myfile.html

Before:
<TR><TD WIDTH=182 ALIGN=left BGCOLOR="#ffffff">\n<NYT_HEADLINE>\n<A\n\nHREF="/onthisday/20020619.html"><FONT SIZE="3" FACE="times"><B>On June 19 ...<BR></B></FONT></A>\n</NYT_HEADLINE>\n<NYT_BYLINE>\n<FONT SIZE="-1"></FONT>\n</NYT_BYLINE>\n<NYT_SUMMARY>\n<FONT SIZE="-1">\n<B>1964:</B> The Civil Rights Act of 1964 was approved.   (<A \nHREF="/onthisday/big/0619.html">See this front page.</A>) <BR>\n<B>1903:</B> Lou Gehrig was born.  <A \nHREF="/onthisday/bday/0619.html">(Read about his life.)</A> <BR>\n<B>1886:</B> Harper's Weekly featured a cartoon about the proposed annexation of Nova Scotia. <A \nHREF="/onthisday/harp/0619.html">(See the cartoon.)</A></FONT>\n</TD></TR>
After:
<tr>\n   <td align="left" bgcolor="#ffffff" width="182"> \n      <nyt_headline> \n      <a href="/onthisday/20020619.html"><font face="times" size="3"><b>On June 19 ...<br></b></font></a> \n      </nyt_headline> \n      <nyt_byline> <font size="-1"></font> \n      </nyt_byline> \n      <nyt_summary> <font size="-1"> <b>1964:</b> The Civil Rights Act of 1964 was approved. (<a href="/onthisday/big/0619.html">See this front page.</a>) \n      <br> <b>1903:</b> Lou Gehrig was born. \n      <a href="/onthisday/bday/0619.html">(Read about his life.)</a> \n      <br> <b>1886:</b> Harper's Weekly featured a cartoon about the proposed annexation of Nova Scotia. \n      <a href="/onthisday/harp/0619.html">(See the cartoon.)</a></font> \n   </td>\n</tr>
" EditorType=boolean TrueFalse=-y| ValueDefault=0 [Remove Comments] Category=0 Description="The -z command-line option removes all stand-alone comments from the input data. This does not include JavaScript comments or comment blocks within APPLET, OBJECT, SCRIPT, and STYLE tags used to hide text from browsers. The revised output should render and function as the original. The -z option is useful in reducing tagged file sizes when the comment blocks are no longer needed, or in removing dead, commented-out sections within documents which tend to collect over time. The stripped comments are not lost, however. These are sent to the 'standard error' stream and may be collected in another file for reference or for use in documentation by 'standard error' redirection ('2>' or '2>>'). If 'standard error' is not redirected, the stripped comments will be seen scrolling by on the screen. Use in combination with the -k option to strip comments without otherwise changing the document layout." EditorType=boolean TrueFalse=-z| ValueDefault=0 [Spaces for Indenting] CallName="-" Category=0 Description="A command-line option from 0 to 9 represents the number of spaces used for increments of indenting. Specifying 0 will cause all indenting to be removed and the tags will shifted to the left. If not specified, the default is to indent by 3." EditorType=numeric Enabled=false MaxVal=9 MinVal=0 ValueDefault=3