[%-# render one level of toc and call recursively itself if there are # nested levels. # expected args: # subs - an array with keys indentical to 'toc' from above. # chap_counter - is a global variable, which should be set to 0 # in the caller for the first loop -%] [%- FOREACH sec = subs -%] [% SET chap_counter = chap_counter + 1%]
-[%- chap_counter -%]. [%- sec.title -%]
[%- IF sec.abstract -%]
[%- sec.abstract -%]
[%- END -%]
[%- END -%]