In a very specific case when our docs don't have multiple pages and the Contents section is empty we should not add the Contents heading because it has no content.
Also, the heading in this case is added as the first level heading which is equivalent to the Documents title. The best practice is to have only one first-level heading - at the very beginning of the document.
I think we should never be able to generate the first-level heading for anything except the page's title. And we should skip the Contents heading if it has nothing inside.
I think we should never be able to generate the first-level heading for anything except the page's title. And we should skip the Contents heading if it has nothing inside.
Example
https://github.com/canonical/karapace-operator/pull/15 -- In this PR we add simple documentation to a product, consisting of a single page.
See the Discourse topic for the documentation.