Allow the table of contents output process to be extended
try0 opened this issue · comments
Hello
Continuing conversation of the previous issue.
Yes, different users may want to customize the way toc is computed in different ways so best is to make it configurable.
Bear in mind that the more configuration one includes, more difficult is to jump start, which eventually leads to less people understanding and using it.
So best is to look at this as an advanced feature and provide a good default.
Kind Regards
Hi
Looking better.
I see 1 issue though.
When you have the following structure:
├── docs
│ ├── Home
│ │ ├── index.pt.md
│ │ ├── index.en.md
│ │ ├── subdirectory1
│ │ │ ├── index.pt.md
│ │ │ ├── index.en.md
│ ├── index.pt.md
│ ├── index.en.md
│ ├── mkdocs.yml
The page title of subdirectory1/index.*.md is rendering as h2. Since it is in a subdirectory, there should be some difference.
Also, can we make items collapsable/expandable?
Maybe it would help if you set a configuration variable to use with mkdocs-awesome-pages:
https://github.com/lukasgeiter/mkdocs-awesome-pages-plugin
This supports the addition of a file named ".pages" per directory which has the navigation configuration like the following:
nav:
- Home: Home
- User Documentation: UserDocumentation
- APIs & Interfaces: APIsInterfaces
- Script Development: ScriptDevelopment
- Models
Thanks!
there should be some difference.
I agree.
Currently, the table of contents is generated based on flat nav.pages. I will improve it to use nav.items to consider hierarchy.
Thanks
Also, can we make items collapsable/expandable?
I don't know if I can implement it, but I'll try.
Hello. Any updates on this?
Hello.
I agree.
Currently, the table of contents is generated based on flat nav.pages. I will improve it to use nav.items to consider hierarchy.
I have finished the first task.
For the time being, I'll release it.
Please wait a little while.
I just released v0.0.8.
Hello
Which configuration params should i include to solve this issue?
Thanks
The default value for the output behaviour is to take the navigation hierarchy into account,
so no changes to the configuration file should be necessary.