Kaggle notebook TOC

How does Jeremy Howard generate table of contents in his kaggle notebooks ?

In Kaggle, it is automatically created when a version of the notebook is saved. The TOC will not be visible in the edit mode tho. All the h2 headings are converted to section headings in the TOC.

A combination of markdown cells in the notebook + nbextensions installed with the toc2 extension enabled (“Table of Contents” selected in the Configurable nbextensions list).