Sphinx: Limit page width in all themes

Created on 17 Nov 2017  路  6Comments  路  Source: sphinx-doc/sphinx

Problem

The following themes do not have a width limit on their pages:

  • nature
  • classic
  • traditional
  • pyramid
  • bizstyle

This can result in extremely long text lines on large screens, making text difficult to read.

Proposal

I propose to change the css of the above projects to limit the page width.

In case there are concerns that this changes the themes and breaks backward compatibility, one could at least add an option, so that users could set the width in the config.

html theme proposal

Most helpful comment

It should be possible to set the body_max_width parameter to strings like initial, none or fill-available.

See also
https://www.sphinx-doc.org/en/master/usage/theming.html

All 6 comments

If the basic idea is ok, I could write a pull request.

+1

Now #4246 is merged. It will be release as 1.7.
Thank you for your contribution!

I understand why you did this, but is there a way that we can configure our setup (add to the conf.py file) so it reverts to max-width:none or max-width:fill-available?

It should be possible to set the body_max_width parameter to strings like initial, none or fill-available.

See also
https://www.sphinx-doc.org/en/master/usage/theming.html

Noting that the PR that fixes this was https://github.com/sphinx-doc/sphinx/pull/4376 (not #4246 -- which is this issue itself -- as noted by @tk0miya).

Was this page helpful?
0 / 5 - 0 ratings