Skip to content
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

Collapsable menu for sections #14

Closed
digitalcraftsman opened this issue Mar 12, 2016 · 16 comments
Closed

Collapsable menu for sections #14

digitalcraftsman opened this issue Mar 12, 2016 · 16 comments
Assignees
Labels
change request Issue requests a new feature or improvement resolved Issue is resolved, yet unreleased if open
Milestone

Comments

@digitalcraftsman
Copy link

digitalcraftsman commented Mar 12, 2016

Hi @squidfunk,

your theme supports nested menus, e.g. you have many section that contains multiple files that are linked.

This would create a very long menu. Would it be possible to integrate an option that allows users to collapse such sections?

@squidfunk
Copy link
Owner

Yes, we could do it via an option. As stated in the open discussion, I'm currently thinking about refactoring the theme a bit, so I will put it on my internal list.

@squidfunk squidfunk added the change request Issue requests a new feature or improvement label Mar 12, 2016
@squidfunk squidfunk self-assigned this Mar 12, 2016
@squidfunk squidfunk added this to the 0.3.0 milestone Mar 17, 2016
@bladorf
Copy link

bladorf commented May 11, 2016

One thing to add - there are some themes running around (see http://helpmonks.github.io/docs/) that have already integrated collapsible menus, but it seems that in doing so they've done away with the nice navigation for header sections within files.

A hybrid of the two would be best - still allow a '##' header to show up in the side navigation, but also allow the collapsing element to deal with long documentation.

@d0ugal
Copy link

d0ugal commented May 11, 2016

For what it's worth, helpmonks is just using a customised version of the readthedocs theme. It sort-of works, but isn't ideal.

@squidfunk
Copy link
Owner

Well, implementing collapsible sections is no rocket science, but the implementation in the read the docs theme from helpmonks is very bad - on mobile, when I open a section, the drawer closes. Therefore I have to open the drawer again to see what the section contains.

The refactored version of the Material theme will definitely have collapsible sections. Loading a page, the current path/section will be open by default and show the table of contents underneath it. However, on desktop the menu will most probably be on the left and the table of contents on the right, like in Google's documentation template which I like a lot.

Hopefully I will have some time in the near future for the next iteration of the Material theme.

@d0ugal
Copy link

d0ugal commented May 12, 2016

... like in Google's documentation template ...

Got a link to that?

@squidfunk
Copy link
Owner

@d0ugal e.g. https://developers.google.com/protocol-buffers/docs/reference/overview

I think it's pretty functional and uses the space on desktop better than the Material theme. It won't be an exact copy, but somewhat inspired by this theme. However, the Google docs kind of suck on the iPhone and on smaller screens in general.

@squidfunk
Copy link
Owner

Another little preview: I borrowed the idea with the download and GitHub link at the bottom - I think it's a quite good call to action.

preview

@d0ugal
Copy link

d0ugal commented May 12, 2016

Thanks for the link, their docs do look nice. I'm also a fan of those links at the bottom, good call.

@squidfunk
Copy link
Owner

Thanks. I realized that a lot of people clicked the "STAR" button, but didnt't star the repository, because GitHub doesn't allow starring or forking it from external sources, so those actions are a two-step process. For this reason I renamed "STAR" to "STARS", but that didn't help improve on it much. For this reason I think it's better to show the stars next to the GitHub icon not in form of a button, but just as text, so it doesn't look like its possible starring it from external sources. It will just take the user to GitHub. That's at least what I learned from my logs.

@squidfunk
Copy link
Owner

Fixed in upcoming 1.0.0, see #46. Issue will remain open until release.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Dec 26, 2016
@nathanaa5
Copy link

@squidfunk How do I create collapsible navigation? I compiled a markdown file to HTML that contains an H1 header and many H2, H3, etc. The navigation shows up on the right side but it isn't collapsible. I've searched all over the repo but can't find documentation on how to make it collapsible. Please help, thank you!

@squidfunk
Copy link
Owner

The table of contents isn't collapsible, I'm sorry. You have to implement it yourself.

@nathanaa5
Copy link

nathanaa5 commented Nov 1, 2017 via email

@squidfunk
Copy link
Owner

Only the navigation is collapsible (on the left side), not the TOC.

@nikita-fuchs
Copy link

Could it be made a thing, please ? Makes manually created TOCs so much more tidy.

@squidfunk
Copy link
Owner

squidfunk commented Oct 12, 2020

@nikita-fuchs you mean an auto-collapsing table of contents, so that only the active section is expanded? That's on the roadmap for Insiders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change request Issue requests a new feature or improvement resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

6 participants