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
hide copy-button in sphinx-immaterial theme #737
Conversation
Thanks for this PR. It seems a bit brittle to me, though. In some themes the alignment is off, sometimes the prompt color is missing, and sometimes the font size is different between prompts and code cells. I think it is more reliable if the prompt uses the same HTML structure as the code cells. Wouldn't it be possible to hide to copybutton with a CSS rule similar to how it's done for |
It is possible to hide it, but it isn't performant because the JS still goes through and adds the copy-button for each prompt on page load. I didn't notice any color discrepancies. I did see varying alignments though. |
Maybe there's a way to still use The sphinx-copybutton ext uses the following selector as a default: Unfortunately, the sphinx-immaterial theme's JS injection isn't as selective: I'll reset this branch and push a new CSS exception for the sphinx-immaterial theme's copy-button. |
Not exactly sure why the RTD build failed. It just says:
But, I see it specified in Line 2 in a619a50
Maybe there's a change in the v9.12.0 release (2 days ago) of readthedocs.org |
The problem should be fixed in the |
uses extra specificity to overrides theme-specific CSS
When I try to build the docs with the immaterial theme, I get this error:
Do you know this error? BTW, building on RTD timed out, currently it's running here: https://readthedocs.org/projects/nbsphinx/builds/20768938/ Do I have to do anything special on RTD? |
I haven't come across that error before. There's a lot of monkey-patches to Sphinx domains in the theme. I don't do anything special for RTD in my projects that doc with sphinx-immaterial theme. If you're building the theme from source then it requires node.js. But I see you installed it from the wheel, so it should be good without node.js. |
Looks like that monkey patch is trying to a CSS class for default values to args in |
Could this be due to the theme_comparison.py script? We ensure parallel-capable extensions are used in our docs. I have a feeling this is related to #738 |
IDK what builder this is, but we don't officially support anything other than HTML builders. We have our CI building with |
I found it. Looks like sphinx added an arg to better support multi-line signatures. Not sure if this was released for v7.0.1 though.
You can't unless you use an older sphinx version, but that negates the change in docs/requirements.txt. We have to update the theme for v7.1 now... |
I re-tried it multiple times on RTD, and now it finally worked: https://readthedocs.org/projects/nbsphinx/builds/20769068/ Maybe it was just a temporary glitch. And yes, I've also found the I just tried the latest Sphinx release, and there it works! |
Even more perplexing. 😕 I already started tracking the |
Thanks! I think I would like to clarify the comments, though: #746. |
resolves #732
Branch reset to use the original approach in which the JS is not bypassed and the resulting copy-button is hidden in nbsphinx CSS.
Despite this approach being less performant with ClipboardJS usage, this approach seems to be the only feasible way to achieve the desired result; see #737 (comment) for a detailed analysis.