textual icon indicating copy to clipboard operation
textual copied to clipboard

Documentation suggestion: Could the "landing pages" for the major sections keep their ToCs more visible?

Open davep opened this issue 1 year ago • 4 comments

Taking https://textual.textualize.io/styles/ into account, if you land on that page and your browser window isn't very wide, or if you're in a mobile view, it can seem like the page is empty:

Screenshot 2022-10-27 at 21 44 15

While the ToC is of course off to the left in the three-bars menu, and there is prev/next navigation at the bottom of the page, the main impression does seem to be that of a "to be done" page (I found it especially tricky to find things on mobile). Making the window just a bit wider does reveal the ToC, of course:

Screenshot 2022-10-27 at 21 44 23

I wonder if it might be possible to stop the ToC disappearing so readily, or perhaps having it in the main body of the page?

davep avatar Oct 27 '22 20:10 davep

Yes, I'm not keen on that behaviour either. I'd prefer that the TOC is shown at the top of the page, rather than hidden in a hamburger menu.

@squidfunk Is there a relevant setting for this?

willmcgugan avatar Oct 29 '22 19:10 willmcgugan

The TOC is on the right (all anchors of the current page). What you're talking about is the navigation sidebar on the left. The sidebar is hidden on widths below 1220px. Over the years, this turned out to be the optimal value to segment notebooks from tablets. If you wish to move that value further down, i.e., to keep the navigation sidebar, you have to recompile the theme and change some variables. Search the code base for 1220px to learn what you need to replace.

Unfortunately it's impossible to make this configurable via mkdocs.yml.

squidfunk avatar Oct 30 '22 11:10 squidfunk

Yeah, it is the sidebar. But I don't think this is necessarily a breakpoint tweak. It's probably related to the type of content we want to display.

let me illustrate... Here's a shot with the navigation sidebar visible:

Screenshot 2022-10-30 at 11 59 40

This page is a reference, so you want to jump around rather than read is sequentially. The index doesn't have much content, because you're expected to click the Style you want via the sidebar.

Here's what it looks like with a smaller window / phone / tablet:

Screenshot 2022-10-30 at 11 59 46

With the sidebar hidden by default, it's not clear how to navigate this page. I honestly would not think to look in the hamburger menu, and I've seen others struggle with that.

I think the current behaviour makes sense for more linear docs, but not for references. I guess what I'd like is for the index page to contain the links in the sidebar, rather than the hamburger menu.

I guess we could compile the index pages ourselves, but it seems like something mkdocs could do for us?

willmcgugan avatar Oct 30 '22 12:10 willmcgugan

I'm not sure what we should do here. On smaller screens, the sidebar needs to be collapsed into the hamburger menu – there's just not enough space to render both. The hamburger icon is learned behavior and has been used for 10 years now. Please note that we always have to strike a balance with Material for MkDocs. Almost empty index pages are nothing we can optimize for. I suggest adding some links to the index page, e.g. using card grids.

squidfunk avatar Oct 31 '22 04:10 squidfunk