Replies: 1 comment 7 replies
-
Thanks for suggesting. I agree, that a warning would be ideal, but since Material for MkDocs is a theme, we can't just add logic to the execution pipeline of MkDocs. We could create a "validation" plugin that would do this and maybe some other checks, but authors would always need to add the plugin explicitly, which kind of defeats its purpose. MkDocs should allow themes to add "please always run this" business logic. Maybe this functionality is something to raise to the maintainers of MkDocs? If there was such a functionality, we'd definitely implement it so authors have a better experience |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I recently had an issue where a documentation page showed zero Table of Contents,

when using this theme with Table of Contents enabled:
Page URL: https://py-pdf.github.io/fpdf2/Templates.html (it has now been fixed)
Page Markdown source at the time of the screenshot: https://github.com/py-pdf/fpdf2/blob/master/docs/Templates.md
This was the original heading structure:
I realized that the problem was due to the default toc-rendering settings set by theblog.structure
plugin:https://github.com/squidfunk/mkdocs-material/blob/9.6.14/material/plugins/blog/structure/__init__.py#L306
I realized that the problem was due to the
toc.html
template definition from this theme:https://github.com/squidfunk/mkdocs-material/blob/9.6.14/material/templates/partials/toc.html
My solution was to introduce a
check_toc
custom plugin to ensure that all pages have only a singleh1
heading:py-pdf/fpdf2#1457
Maybe at least a warning should be produced by the
blog.structure
plugin when this situation arise,to inform the end-user why there is no Table of Contents displayed in the side bar?
Beta Was this translation helpful? Give feedback.
All reactions