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

Do not use theme as extension, this should be made redundant #1479

Closed

Conversation

benjaoming
Copy link
Contributor

@benjaoming benjaoming commented May 23, 2023

This seeks to demonstrate that our setup(app) block is called correctly and all subsequent functionality is called as intended. Including the call to jquery_add_js_files that was broken because themes cannot activate extensions.

https://github.com/readthedocs/sphinx_rtd_theme/blob/master/sphinx_rtd_theme/__init__.py#L41-L85

@benjaoming benjaoming requested a review from a team as a code owner May 23, 2023 11:23
@humitos
Copy link
Member

humitos commented Aug 22, 2023

If this is true, we should update our installing instructions as well https://sphinx-rtd-theme.readthedocs.io/en/stable/installing.html

@humitos
Copy link
Member

humitos commented Aug 19, 2024

I don't 100% understand the Sphinx internals, but it seems we cannot remove the installation as an extension: #1434 (comment)

@humitos humitos closed this Aug 19, 2024
@benjaoming
Copy link
Contributor Author

Hi @humitos

I recently had to deal with yet another instance of this bug, it keeps coming up :) It's because of defining html_theme_path in conf.py which should not be needed, but has been part of many many instructions and circulating copy-pasta.

In the case in question, it's defined here:

https://github.com/LGouellec/streamiz/blob/d1a0b73b2ebc5a82c8d00babf16b51f2a7423841/docs/conf.py#L61-L64

I tried to summarize the issue here: #1434 (comment)

Another thing is that maybe the need for html_theme_path needs to be understood better... but I think that the entire code block above should be possible to remove.

@humitos
Copy link
Member

humitos commented Aug 19, 2024

Hey 👋🏼 .

It's because of defining html_theme_path in conf.py which should not be needed, but has been part of many many instructions and circulating copy-pasta.

Yeah, it seems we removed this from our installation page a while ago now.

We still have the function get_html_theme_path() declared in our code. So, it would be probably a good idea to remove it from there and make those projects defining html_theme_path to hard fail; so they can upgrade.

@benjaoming
Copy link
Contributor Author

@humitos that sounds like a good way forward because the missing JQuery causes confusion and can waste a lot of time in debugging and for the users that are impacted (negatively impacting for instance search). If possible, a potential compromise could be to have a DeprecationWarning lodged in an intermittent update, then remove it completely (or rename it, in case there's something unanticipated that really needs it).

@benjaoming benjaoming deleted the remove-theme-as-extension branch August 19, 2024 14:38
humitos added a commit that referenced this pull request Aug 19, 2024
@humitos
Copy link
Member

humitos commented Aug 19, 2024

If possible, a potential compromise could be to have a DeprecationWarning lodged in an intermittent update

I added a commit cc5067a (#1576) to our 3.0.0rc1 release 👍🏼 . Let me know if that works.

humitos added a commit that referenced this pull request Aug 20, 2024
* Tests: `sphinxdev` tox environment installs Sphinx from `master`

It seems we had a bug in the name and it wasn't installing Sphinx from `master`.
I expect this test to fail now because we pin `Sphinx<8`, but that's fine for now.

* Prepare for 3.0 release

- Drop Python <3.8
- Drop docutils <=0.18
- Add support for docutils 0.21
- Add support for Python 3.12

This follows the plan we wrote in
https://sphinx-rtd-theme.readthedocs.io/en/stable/development.html#roadmap-release-3-0-0

The main idea here is to move forward with newer versions and drop support for
old stuffs so we reduce the maintanence burden.

* Update CircleCI matrix

* More fixes to CircleCI

* Run test over Sphinx 8.0

* Update contributing guide

* Remove deprecated `readthedocs-sphinx-ext`

* Remove old Sphinx versions

* Uninstall our extension

* Show a warning if `extra_css_files` is in the `html_context`

See #450

* Update development page

* Add deprecate warning for `analytics_` theme options

* Update docs

* Remove unused dependency

Closes #1533

* Remove environment variables from our docs

This was already added in a more generic way to the theme itself.

* Require Sphinx >=6.0

* Deprecation warning about `get_html_theme_path`

See #1479 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants