\starttext

\dorecurse{10}{
    \startchapter[title=Chapter #1,reference=chapter:#1]
        \dorecurse{10}{
            \startsubject[title=Subject #1]
                \dorecurse{2}{\samplefile{tufte}\par}
            \stopsubject
            \startsection[title=Section #1.##1,reference=#1.##1]
                \dorecurse{10}{\samplefile{tufte}\par}
            \stopsection
        }
    \stopchapter
}

\stoptext
