pymc-labs / labs-sphinx-theme

Sphinx theme for OSS projectw within PyMC Labs
Other
0 stars 0 forks source link

[proposal] increase width of main content section #1

Open drbenvincent opened 3 months ago

drbenvincent commented 3 months ago

I find the width of the main central content part too narrow. For example, when we have code, it very often runs off the edge of the page, requiring scrolling in code blocks.

For laptop and desktop viewing, this narrowness is not required as the total width of all content easily fits on the screen.

For mobile or tablet, then the adaptive dropping of the left/right columns does the job, or will require scrolling in code blocks regardless.

I think the only/main argument against this is that having extremely wide content can reduce readability. But I'm only suggesting that we make wide enough so that we don't need to horizontally scroll very much when viewing code.

drbenvincent commented 3 months ago

An example from pymc-marketing

Screenshot 2024-07-25 at 16 59 41
OriolAbril commented 3 months ago

This page shows how it can be done: https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/layout.html#horizontal-spacing.

However, it should be noted that this setting is explicitly set by the pydata-sphinx-theme because otherwise it difficults readability, especially for people without perfect sight. If notebooks are automatically formatted so code has at least X characters per line, we could modify so the page fits exactly that number of characters which might be a good compromise, if that were too wide then we could reduce the max number of characters per line in the formatter and increase the width a bit. If notebooks aren't automatically formatted then it is bound to not help anyone, readability will be decreased yet scrolling will continue to be necessary.

drbenvincent commented 3 months ago

My preference would be to do the (small) increase in width needed to fit ruff/black formatted code. I don't know the number of characters off the top of my head.

My main concern is that the width is not wide enough to accommodate the standard line length.

We shouldn't try to accommodate widths of poorly formatted notebooks.

maresb commented 3 months ago

Ah, great point! Default is 88 characters wide. A quick approximate count was about 83 currently showing, so I think it just needs a minor increase.

(Some people like enabling really wide lines in the code formatter, but I personally appreciate narrow lines due to cases like this.)