Closed xymeng16 closed 3 years ago
a discussion (no related file):
Hmm, but we have `sphinx==1.8.0` in our `requirements.txt`? So, I'm not sure if we should add IFs for other versions, I don't think we support them. CC: @woju
Oh, thanks for your reply. I have the sphinx installed in my environment so I ignored the requirements.txt
. So if applicable, please ignore and close this PR.
(FYI, at least sphinx 4.1.2 and 4.0.0.b2 work based on my tests.)
I'm unconvinced. We can't update sphinx at least until 22.04, because 20.04 still has sphinx 1.8 and we will need deb-packaged sphinx to build manpages in our debs (its not only for rtfd.io, where we could have greater latitude). When we'll be eventually upgrading, we'll just rename the function, without this conditional. So unless I miss something, this brings nothing but maintenance. If anything, I would prefer a comment # after sphinx $VERSION, rename this to .add_css()
.
Thanks for the PR, @xymeng16, but based on input from @mkow and @woju looks like we should close it.
This PR is related to building the documentation.
In the setup() function of conf.py, app.add_stylesheet() is used to add a CSS file. But this only works for Sphinx under version 1.8 as Sphinx has renamed app.add_stylesheet() into app.add_css_file() since version 1.8. Hence I added a version check before invoking that to avoid that such an error happens.
How to test?
Change the directory into Documentation/, and use
make html
.This change is