Translations:Manual:Table of contents/16/en

See $toc and the relevant rules at $Common for an example implementation.