$document$
$if(chapter)$
$chapter$
$endif$ $if(link)$
$if(toc)$ $for(link)$ $if(link.toc)$
$table-of-contents$
$else$
$link.title$
$endif$ $endfor$ $else$ $for(link)$
$link.title$
$endfor$ $endif$
$else$ $table-of-contents$ $endif$
$body$