-
Notifications
You must be signed in to change notification settings - Fork 329
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
Maximum width of the main body of the page #17
Comments
One site to use for inspiration is the Tufte CSS demo site: https://edwardtufte.github.io/tufte-css/ For that site, the main content section maxes out at a width of 770px. Perhaps we can follow something close to this for the sphinx theme Note that this can be relatively easily accomplished with something like: nav#navbar-main, div.container-fluid, div.footer {
max-width: 1000px;
margin-left: auto;
margin-right: auto;
} We may also want to give the main content "div" its own ID (e.g. |
+1 to doing something here. I noticed this especially for tables with only a few columns. https://dev.pandas.io/docs/user_guide/boolean.html. Or should the table issue be resolved with its own max-width / styling? |
Looks nice! A few quick thoughts:
|
Thanks for the screenshots! Personally (but yeah, I also developed the initial version .. ;)), I like the one that keeps the layout as it is now (with TOC sidebar on the right) the most. I agree with @choldgraf that having this on the right seems a common thing to do. I think the collapsible navigation component for the TOC would still be useful for smaller screens, where the TOC sidebar doesn't fit (right now, it simply disappears, but it could go into such a collapsible TOC). |
@jorisvandenbossche I use a within-page topbar to keep a placeholder for the table of contents, so that it only shows up when the screen is wide enough, but when the screen is narrow users can hover (or click) over the "toc" button and it'll show, e.g.: (also see the arrow for the left across-pages navigation collapse. a lot of users of jupyter book like that 👍 |
In case we keep the 3-bar layout (topbar, left + right sidebar with central body content), I think the main question becomes how to align this content on the screen (what @choldgraf mentions about centering vs left-justifying). Just putting some other examples here of different options: Readthedocs (https://docs.readthedocs.io/en/stable/index.html) -> they left-justify everything (but don't have a separate left TOC sidebar), resulting in a lot of white space at one side of the screen (or grey space here ;)). I think this is what @choldgraf mentioned above about noticing whitespace more if it is all on one side. Some projects using readthedocs therefore also customize it to put the content in the middle, see eg https://xtensor.readthedocs.io/en/latest/ Similar to how xtensor centers the content with readtheocs, another example of this: Elixir docs (https://hexdocs.pm/elixir/library-guidelines.html#getting-started) -> they center the main text, but keep the left sidebar left-aligned Docker (https://docs.docker.com/engine/docker-overview/) -> they left-justify the text body, but keep the TOC sidebar right-justified (and so no longer directly next to the text). Although it is left-justified, the amount of "whitespace in the middle of the screen" is still somewhat limited (at least on my screen) because the width of the main text is still relatively big. Git book, eg Metaflow docs (https://docs.metaflow.org/introduction/what-is-metaflow) or tiledb (https://docs.tiledb.com/main/use-cases/dataframes) -> they center the main text content together with left and right sidebar next to it, leaving the whitespace fully on the right and on the left Plotly (https://plot.ly/python/plotly-express/#maps) -> similar as the one above in that they center the content + sidebar together (but they only have one sidebar) Tensorflow (https://www.tensorflow.org/guide/keras/overview) -> the left sidebar is left-justified, and then I think the main text body is centered with the right TOC sidebar put next to the text (but not taken into account for centering). But would need to look at the exact number of pixels or the css to be sure :) Other example of the same concept (another google site, https://developers.google.com/protocol-buffers/docs/pythontutorial): Let's also show the other deep learning framework to stay neutral :) https://pytorch.org/docs/stable/notes/autograd.html -> I thought this started as a readthedocs fork (but nowadays it is less visible, or it changed). So everything is also left-justified, but because everything is quite wide, the whitespace on the right annoys me not as much here. Sparklyr / RStudio (https://spark.rstudio.com/dplyr/) -> they left-justify the left-sidebar + content, but keep the TOC sidebar right-justified So far the doc sites I gathered over the year thinking about a better theme .. Sorry for the long post :) |
And additional issue is: depending on how the content is aligned, the alignment of the items in the top header bar could also be under discussion. |
To me the Gitbook / Metaflow alignment is interesting. In this layout the navigation (both left/right) stays close to the content it is describing. Also center-aligning the top header bar might feel good in combination with centering the content. |
gitbook/metaflow is exactly what I'd like :-) Also interesting to see they adopted the same 'edit on github' pattern in the right TOC bar that we did! |
Yes, for me exploring the gitbook/metaflow layout sounds certainly good! One possible counter point of having the content centered, but not the sidebars, is that it can give more "focus" on the main content. Eg with bookdown: (but they have only one sidebar, so less bars anyway) But I suppose that as long as we don't make the sidebars look "too heavy", that's no problem. And we should maybe rather implement a "focus mode" with a toggle to hide the sidebars, if that is something that people want. |
Either one is fine with me, so long as the content is centered (and ideally so that the right-page TOC stays with the content). Basically everything that is "about the current page" should be bundled together and centered, and other stuff I think is OK to be floating. |
I do agree on keeping everything 'about the current page' close to the main content. I will provide a mockup with the content centered before heading over to coding it. |
I think it looks quite nice! A few questions:
|
Do we agree on the full centered version based on Gitbook / Metaflow working towards my latest mockup? |
Yep, I think your latest mockup looks nice, +1 from me 👍 Re: the extension point thing, it just seems like that's a slot that other kinds of buttons could be added to if they existed. Maybe expanding out horizontally? Either way, I think that's a different issue to tackle :-) One thing though: I would make the search bar configurable to either be in the top-bar, or in the sidebar. Some of our docs are already close to maxing out our top-bar space |
Ok, thank you for the thoughts. I suggest to keep the search bar to the left as it is now. Then later add in as a separate feature making the search bars position configurable? |
+1 from me on that, I think that search bar location is orthogonal to content centering - I'll open an issue about the search bar |
Need to go through the above discussion, but +1 on going forward with a gitbook/metaflow like style and the mockup! |
@chrisjsewell sorry for the late reply. I indeed also see that issue on https://jupyter-cache.readthedocs.io/en/latest/#, but on https://pydata-sphinx-theme.readthedocs.io/en/latest/ |
Closed by #134 |
@chrisjsewell actually, I remember now we had a similar issue with pandas, which in the end turned out to be related to our usage of nbsphinx, and related to the usage of requirejs (see #25, and #30 for the more general issue). It might be something similar? |
Currently there is not max width, resulting in too wide text of the main body of a documentation page on big screens.
The text was updated successfully, but these errors were encountered: