Skip to content

html_style works locally but not on ReadTheDocs #885

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

Closed
Suor opened this issue Aug 12, 2014 · 7 comments
Closed

html_style works locally but not on ReadTheDocs #885

Suor opened this issue Aug 12, 2014 · 7 comments
Labels
Bug A bug

Comments

@Suor
Copy link

Suor commented Aug 12, 2014

I use readthedocs theme both locally and on ReadTheDocs. However, html_style has no effect when docs are compiled on the service.

By the way, I am just trying to add some custom CSS. Here is my conf.py - https://github.com/Suor/funcy/blob/master/docs/conf.py

@ericholscher
Copy link
Member

Here is the code that sets these variables: https://github.com/rtfd/readthedocs.org/blob/master/readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl#L21-L51 -- looks like it might be overriding your custom style. We do this to keep things consistent when using our own theme, but I could probably be convinced to change it for a good reason.

@Suor
Copy link
Author

Suor commented Aug 13, 2014

There definitely should be a way to add some css, preferably an easy one and documented. html_style is documented is sphinx docs, it's not easy to use though, cause you need to add @import and you usually don't know what to write there.

Current situation is, however, meaning html_style is useless and there is no easy way to add custom css to your docs. So I suggest one of two variants:

  1. Make html_style work as it described in sphinx docs, also document in rtd docs how one should use it. E.g. explicitly state that one should add @import "rtd.css" (or whatever, I am still not sure) on top your css file.
  2. Make a separate setting to add css files, and probably js ones, to pages heads. Document it in rtd docs.

(1) is not backward compatible, srictly speaking, but since nobody probably uses setting that doesn't work shouldn't cause much trouble.

@tshead2
Copy link

tshead2 commented Oct 6, 2014

I second the motion ... there are a handful of small CSS tweaks I'd like to make in my docs, and either of the suggestions by @Suor would be very welcome.

@delfick
Copy link

delfick commented Feb 15, 2015

@gregmuellegger
Copy link
Contributor

We are now displaying the actually used conf.py in the build process. You can have a look and see in which cases we override the html_style configuration. You can override the value properly when setting html_theme = "sphinx_rtd_theme".

@logemann
Copy link

doesnt make any difference to me. html_style is still being ignored.

Or better said, when looking at conf.py at build time, you dont override html_style but on the other hand you dont include it in the html source either.

@agjohnson
Copy link
Contributor

There is a pattern for this in our docs now:
http://docs.readthedocs.io/en/latest/guides/adding-custom-css.html

Closing this here as I don't think we'll change this

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

No branches or pull requests

7 participants