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

sphinx-tabs assets are not removed from pages where tabs aren't being used #184

Open
peytondmurray opened this issue Nov 4, 2023 · 0 comments
Labels

Comments

@peytondmurray
Copy link

Describe the bug

I was in the process of investigating another issue, and I think sphinx-tabs assets are not currently being removed from pages that they should be in v3.4.4. Here's the result of a debugging session:

image

As you can see, the path in context["css_files"] check here is not quite right. path is of type PosixPath, and the only thing contained in context["css_files"] are objects of type sphinx.builders.html._assets._CascadingStyleSheet. If I check the HTML built by sphinx, I can see that the tabs.css is included, confirming the bug:

image

I think what we want here is

if path.suffix == ".css" and path in [Path(f.filename) for f in context["css_files"]]:

Reproduce the bug

I've updated the minimal working example to use the most recent version of sphinx-tabs: https://github.com/peytondmurray/minimalsphinx/tree/per-page-css

List your environment

No response

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

1 participant