New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
smart section titles when no navigation is configured #3356
Comments
+1 to this feature, the default section titles are not ideal, it's also hard to sort the directory order. |
Perhaps you could provide a short example? |
This repository contains a simple example: https://github.com/realtimeprojects/mkdocs-sample/tree/master This is how the page looks like at the moment: Given the feature |
Here is the PR with a basic implementation: |
Thanks for the example site, that does make it clear. The functionality that this request is about is specific to mkdocs-material. It doesn't make sense to apply a workaround in MkDocs to make section titles calculated based on a page, because in MkDocs there's never any direct relation between a section and a page inside it. If you try this with any other theme, it doesn't make any sense anymore. I tried this out with the plugin "mkdocs-section-index", which does create these explicit associations in a generic way, but sadly it suffers from the same deficiency. Though implementing this functionality there would make a lot of sense. |
And let me leave you with a fun tidbit. This example site contains all kinds of plugins and extensions that one would need to install. I just create the following file [env]
requires = ["hatch-mkdocs"]
[env.collectors.mkdocs.docs] And then running |
Given no navigation tree is defined in the configuration, the section titles for sub-directories should be determined by the following logic:
The user should be able to turn on/off this behaviour by a configuration option, e.g.
The text was updated successfully, but these errors were encountered: