Skip to main content

linenumbers

Display text with line numbers.

def linenumbers(
value: string,
autoescape: boolean = True
) - > string

Display text with line numbers.

Parameters

NameTypeDescription
valuestringThe raw text content to be formatted with line numbers.
autoescapeboolean = TrueDetermines whether the input text should be HTML-escaped before line numbers are applied.

Returns

TypeDescription
stringThe input text with each line prefixed by its corresponding line number, zero-padded to match the width of the total line count.