$def with (edition, ocaid=None) $ table_of_contents = edition.get_table_of_contents() $if table_of_contents and len(table_of_contents) > 1:

$_("Table of Contents")

$for toc in table_of_contents: $if ocaid and toc.pagenum.isdigit(): $else:
$toc.label$toc.title$toc.title $toc.pagenum