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

Conflict with pydata-sphinx-theme #180

Closed
K20shores opened this issue Oct 5, 2023 · 6 comments
Closed

Conflict with pydata-sphinx-theme #180

K20shores opened this issue Oct 5, 2023 · 6 comments
Labels

Comments

@K20shores
Copy link

Describe the bug

context
When I do use this package with pydata-sphinx-theme, the version switcher for that project does not work.

expectation
I expected both packages to work without affecting each other.

bug
But instead adding sphinx_tabs.tabs to the extensions, without even using a tab, the version switcher for that package no longer works. I filed an issue on that repository, but I figured it might be useful to have this tracked here as well.

problem
This is a problem for people wanting use this package with pydata-sphinx-theme

Reproduce the bug

Just follow the steps listed in this issue

List your environment

No response

@K20shores K20shores added the bug label Oct 5, 2023
@welcome
Copy link

welcome bot commented Oct 5, 2023

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@foster999
Copy link
Collaborator

Thanks for this, what do you mean by version switcher?

@K20shores
Copy link
Author

Thanks for this, what do you mean by version switcher?

Here's an example from the theme home page. There's a dropdown you can choose to see document version.

Screenshot 2023-10-05 at 11 53 25 AM

For whatever reason, sphinx tabs prevents something from loading. I'm not positive, but I believe there is a script added to the page which makes a get request for the switcher URL. I don't quite understand how this extension would prevent that, but of the extensions we use in my project, disabling the tabs is the only one that allowed our switcher to show.

@mathpl
Copy link
Contributor

mathpl commented Oct 21, 2023

I got the same issue and with a little bit of debugging I think I understand the area of the code that's problematic, I'm not quite sure how to properly solve it as I don't have much experience developing for sphinx. I'll put a PR up with what fixes it for me so you can have a look.

The gist of it is commenting this line https://github.com/executablebooks/sphinx-tabs/blob/v3.4.1/sphinx_tabs/tabs.py#L333 fixes it. Removing https://github.com/executablebooks/sphinx-tabs/blob/v3.4.1/sphinx_tabs/tabs.py#L361 altogether also fixes it.

pydata-sphinx-theme does something a bit unusual with its JS, it's added as inline code without a filename. See: https://github.com/pydata/pydata-sphinx-theme/blob/main/src/pydata_sphinx_theme/__init__.py#L261-L274. It does appear to be supported by sphinx however.

@mathpl
Copy link
Contributor

mathpl commented Oct 21, 2023

Proposed fix: #181

@foster999
Copy link
Collaborator

Fixed in the latest release, thanks @mathpl 🥳

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

No branches or pull requests

3 participants