Skip to content
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

Latest versions seem to be incompatible with max width changes #1250

Closed
EmmaRenauld opened this issue Nov 2, 2021 · 3 comments
Closed

Latest versions seem to be incompatible with max width changes #1250

EmmaRenauld opened this issue Nov 2, 2021 · 3 comments
Labels
Bug A bug Needed: replication Bug replication is required

Comments

@EmmaRenauld
Copy link

Problem

My read-the-docs, which worked fine and still works when builded directly from github, now has a broken layout when building locally on my new environment. I now have:

  • python 3.9
  • sphinx_rtd_theme 1.0.0
  • docutils 0.17
  • sphinx 4.0 (I also tried 4.1)
    (i.e. all are supported dependencies)

The page builds but the layout is broken. I found that if I remove the additional my_style.css from the conf.py page, where I was modifying the page width (.wy-nav-content { max-width: 100%;}), such as suggested on many forums, it works again. Which means that I need a new solution to change the max width.

Thanks!!

Reproducible Project

https://scil-documentation.readthedocs.io/

Error Logs/Results

image

@EmmaRenauld EmmaRenauld added Bug A bug Needed: replication Bug replication is required labels Nov 2, 2021
@nienn
Copy link
Contributor

nienn commented Nov 2, 2021

The link you posted for the reproducible project has the my_style.css file with the .wy-nav-content { max-width: 100% } styles applied to the page and seems to work fine.

Is it only locally that you are experiencing the broken layout? Could that be a cache problem?

@nienn
Copy link
Contributor

nienn commented Nov 2, 2021

On a second thought, by the screenshot you attached — I'm assuming it's from the local build — you are not even getting the css files.

I think it's probably because of a wrong setup here:
github.com/scilus/scil-documentation/blob/c86133c4fb60df0556ef855e668f221fa331eb0d/source/conf.py#L96-L100

Please try removing the _static/ from the css file path, as that's already referenced above, and refer to html_css_files instead. It should become:

html_css_files = [
    'my_style.css',  # overrides for width size
]

More information here: docs.readthedocs.io/en/stable/guides/adding-custom-css.htm

@EmmaRenauld
Copy link
Author

EmmaRenauld commented Nov 2, 2021

It was indeed only locally broken, and your fix did the trick. I'm not sure why it was working online. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug Needed: replication Bug replication is required
Projects
None yet
Development

No branches or pull requests

2 participants