Numbered pages and sections

There are a couple of use-cases to have numbered pages and sections in all parts of your documentation.

The most common use case is about table of contents. When you display a table of contents using a numbered list of all chapters of your documentation, you want the user be able to refer to these chapters as numbers. The recipe below explains how to implement this.

The examples below use the existing page tree of the default Webhelp theme, delivered with Scroll Viewport.

If you need to implement this in a theme made from scratch, you may need to omit or change some of the classes used in the CSS. For example .ht-content and #ht-sidebar are specific to the Webhelp theme.

When implementing this recipe, you will be able to automatically number all sections in the page tree and content, starting from the second tier - of course, you can configure that in the code - see line 17.