sphinx-book-theme icon indicating copy to clipboard operation
sphinx-book-theme copied to clipboard

Offer option to put nav-bar on left, under logo?

Open goodboy opened this issue 4 years ago • 6 comments

I'm a big fan of minimalism and really love the nav bar on the top right in this theme.

I'm wondering would it be crazy to ask if that nav bar could be optionally moved into the left sidebar under where the logo normally sits?

I'm unfortunately a super newb with web front end stuff otherwise I would suggest a solution through a PR.

My hip shot guess would be to somehow conditionally offer the docs_navbar inside the docs_sidebar block?

I'd be much appreciated to get any guidance on how to make this possible 👍🏼

Thanks again for the very cool and useful theme!

goodboy avatar Feb 28 '21 19:02 goodboy

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

welcome[bot] avatar Feb 28 '21 19:02 welcome[bot]

I don’t think this would be too hard to accomplish. It might take a bit of reworking the template but I don’t think it’d be too hard. I think your analysis is mostly right, we’d probably also need to If anyone wants to take a shot I am happy to look over. 👍

I think to do this we’d need the following

here is where the sidebar adds the navigation,

https://github.com/executablebooks/sphinx-book-theme/blob/c9fae28a006ddc7ba79b53a7b50eff3f011ff5cd/sphinx_book_theme/_templates/sbt-sidebar-nav.html#L2

We’d need to add functionality to keep the within page headers somewhere around here https://github.com/executablebooks/sphinx-book-theme/blob/c9fae28a006ddc7ba79b53a7b50eff3f011ff5cd/sphinx_book_theme/init.py#L105

and make the top bar toc optional via the new config https://github.com/executablebooks/sphinx-book-theme/blob/master/sphinx_book_theme/topbar.html#L27

choldgraf avatar Feb 28 '21 20:02 choldgraf

@choldgraf sweet!

Glad to hear you are accepting of the idea.

I will try to take a shot at this sometime this week time permitting.

If you already have an idea how to punch it out quick I'd be more then happy to test as well 🏄🏼

goodboy avatar Mar 01 '21 01:03 goodboy

Well the main thing that I was considering is that Sphinx natively supports something like this. For example, the readthedocs sphinx theme has headings of the current page embedded in the left sidebar, instead of being in a right sidebar. What do you think about following a similar pattern?

choldgraf avatar Mar 01 '21 01:03 choldgraf

I think simpler is better and the right nav-bar looks super great, especially the dynamic section-scroll tracking and unfolding UX. This is something I wish every docs had so you know where you are in the index.

For me, I don't really need the nav-bar on the right and would much prefer it as an option to include on the left. If sphinx has built-in support that seems an even better reason to use it.

In my opinion having the nav-bar on the right and having content on the left (despite it being user defined) can get slightly cluttered.

I would rather be able to choose what is included on the left sidebar and if I really wanted something on the right (though I'd argue there's enough going on with the cool margins support) then having that option is always handy. Personally though, I think you can just avoid the magic that tries to avoid nav-bar + margin content collisions for the most part if you support the "dynamic" nav-bar on the left.

I also think you'll save users the time of trying to figure out their own indexing on the left since the nav-bar pretty much takes care of it and I can't think of a TOC / index that will look any better.

Hopefully that's not too long winded 😂

goodboy avatar Mar 01 '21 02:03 goodboy

has headings of the current page embedded in the left sidebar, instead of being in a right sidebar.

If you could make the right side nav-bar appear under the current major section on the left I think that could also look great.

goodboy avatar Mar 01 '21 02:03 goodboy