If your HTML file does not include a table of contents, you will need Calibre to generate one for you. Click on the “Table of Contents” tab to make sure that the generation is accurate.
If your book does not have a Table of Contents, you can force Calibre to generate one by clicking the “Force use of auto-generated Table of Contents.” Calibre will then save your book with the auto-generated table of contents.
On this panel you can also define the maximum number of links to appear in your table of contents, what the minimum number of chapters there should be to turn off the links, and even a filter to remove items from the table of contents such as Appendices or other extras. You can also use XPath to define the exact elements to be detected and placed in the table of contents.
The next page will get your file set up to save as a Mobi file for Kindle.