{{ define "recurse-toc" }}
  {{ $s := .section }}
  {{ $psid := .psid }}
  {{ $pages := (union $s.Pages $s.Sections).ByWeight }}
  {{ $subSection := 1 }}

  {{ range where $pages ".Params.no_print" "!=" true }}
    {{ $sid := printf "%s%d" $psid $subSection }}
    {{ $subSection = add $subSection 1 }}
	{{ partial "print/toc-li.html" (dict "sid" $sid "Page" .) }}
    {{ if .IsSection }}
    <ul>
        {{ template "recurse-toc" (dict "section" . "psid" (printf "%s." $sid)) }}
    </ul>
    {{ end }}
  {{ en