tombreit / mkdocs-pagetree-plugin

MkDocs plugin that allows you to display the page tree. Like `sitemap.xml`, but for humans.
https://tombreit.github.io/mkdocs-pagetree-plugin/
MIT License
2 stars 0 forks source link

request: Can I render only children pages or bro-and-children pages tree? #9

Open uechoco opened 5 months ago

uechoco commented 5 months ago

It's nice plugin. As I look at demo pages, the plugin always renders all pages tree even if it is used in a sub-page. Can I render only children pages or bro-and-children pages tree?

tombreit commented 5 months ago

Yes, currently this plugin always renders the whole page tree.

Your idea of only showing siblings and children of the current side sounds good and interesting. What options do you have in mind?:

However, this would have to be configurable somehow, I would have to take a look at it - or: a pull request is very welcome.

tombreit commented 5 months ago

This plugin supports two three new "tree rendering options" from now on:

Some demo pages are available: https://tombreit.github.io/mkdocs-pagetree-plugin/

I would now consider this to be "beta", but you are welcome to test it. As I did not made a release for now, you could install it from git:

~~$ pip install git+https://github.com/tombreit/mkdocs-pagetree-plugin.git@150339881c3739ec87922c7bbb757216a9e4876a~~

$ pip install git+https://github.com/tombreit/mkdocs-pagetree-plugin.git@e666155cf936388199d050c73ab8c854f6f953d1
uechoco commented 5 months ago

Thank you for your rapid support! I seem it works.

By the way, if mkdocs.yml includes nav tree settings, I seem that this plugin renders in range of nav tree definition. Is this behavior restriction of mkdocs? I sometimes forget to add a page to the nav tree settings. I thought it would be more useful to have an option to ignore the nav settings and display the file tree according to the files that actually exist.

Anyway, thank you again.

tombreit commented 5 months ago

I don't use a nav setting in this very project's mkdocs.yml (https://github.com/tombreit/mkdocs-pagetree-plugin/blob/main/mkdocs.yml) and the pagetree contains all pages: https://tombreit.github.io/mkdocs-pagetree-plugin/

Do you have a demo repository you could share that demonstrates this behavior?