Adding line numbers

back to index

By default, line numbers are not generated. You can turn them on with the showLineNumbers property, setting it either to "true" or "false".

HTMLConverter   boolean getShowLineNumbers()
void setShowLineNumbers( boolean onoff)
Code2Web   code2web ... --showLineNumbers = true | false...
<c2w:convert>   <c2w:convert ... showLineNumbers="true|false" ... >

 

The style applied to the generated line numbers is controlled by the lineNumberStyle property. The default value is "line-number"

Eclipse Netbeans Monochrome Citylights
0049 0049 0049 0049

 

 

HTMLConverter   String getLineNumberStyle()
void setLineNumberStyle( String newStyle )
Code2Web   code2web ... --lineNumberStyle = style ...
<c2w:convert>   <c2w:convert ... lineNumberStyle ="style" ... >

 

You can also control how the numeric value of a line number (49) is converted to a string prior to printing it. You might want to add leading zeros, to add thousand separators, whatever. This is controlled by the lineNumberFormat property, which has a default value of "0000", which basically means "4 digit number with leading zeros if necessary". The format that this property uses is the same as the one of the DecimalFormat class.

 

HTMLConverter   String getLineNumberFormat()
void setLineNumberFormat( String format)
Code2Web   code2web ... --lineNumberFormat = format ...
<c2w:convert>   <c2w:convert ... lineNumberFormat ="format" ... >