-
Notifications
You must be signed in to change notification settings - Fork 2
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
Added conditional to support sphinx gallery pre and post v0.11 #2
Conversation
Thanks, this looks promising, but my main concern is: what happens if I don't want to add a hard dependency to Originally, I was concerned about the dependency to |
Thank you for the quick feedback! |
Thanks for the update! I agree, local imports make sense in this case. I think the
Well I would assume that if somebody doesn't want to use the CSS from FYI, I would like to wait a bit with merging this, because there still seems to be some activity in sphinx-gallery/sphinx-gallery#998, and maybe the HTML is changed again. But once that's clarified, it would be great if you could keep the line lengths to 79 characters. If you don't have time for that, I can also do it for you. As an alternative, I'm playing with the thought of dropping the whole What do you think about that? |
Thank you for your explanations! If someone defined their own CSS to style the On the other hand, emitting custom html to mimick the architecture of But somehow it also feels un-pythonic to have two separate python packages independently providing very similar functionality (galleries of python scripts and notebooks)... Maybe some reliable common code base for synergies or even a fusion of both projects might also be a long-term perspective? But I don't have that kind of insight into either project to provide good advice here. Anyway, in case this PR is not being made obsolete by other developments, I adjusted the line lengths to good old Fortran style. |
Just checking: As the activity in sphinx-gallery/sphinx-gallery#998 is not really overwhelming since a while, what are your plans about this PR here? If no changes are expected for a while, I guess I'll just pin the version of sphinx gallery to 0.10.1 for my project - not my favorite solution though... |
Thanks for keeping an eye on this! I stated my opinion in sphinx-gallery/sphinx-gallery#1005 (comment), and there I mentioned that I'm not in a hurry. That was nearly two months ago. I didn't see any further activity.
I wanted to wait if the sphinx-gallery people can provide better HTML. As it is right now, I'm not willing to accept it.
Those people (if they exist), will have to change their CSS anyway, since sphinx-gallery re-used their old CSS classes and gave them a completely different meaning. So for those people, it doesn't matter if they switch to the new (and incompatible) style of sphinx-gallery or if they switch to a potential new (and incompatible)
Yeah, that's why I originally wanted to replicate the HTML of sphinx-gallery to be able to re-use their CSS.
Yeah, a "gallery" Sphinx directive would be great. It would make sense for the sphinx-gallery project to provide such a thing, but they don't. There's https://github.com/executablebooks/sphinx-design/, but for this use case it seems a bit heavy-weight to me.
I don't think that's feasible, because the technology for analyzing and running the notebooks is quite different. And I think it is actually good to have multiple independent projects who use different approaches to do similar things. There is also MyST-NB, which again uses different techniques to implement similar things (but it currently has no gallery feature, see executablebooks/MyST-NB#396).
Yeah, I'd recommend that for now. But I'm not sure how to proceed. What do you think? |
Thanks for the quick and deep answer! |
In case you are interested, I did some experiments in the branch https://github.com/mgeier/nbsphinx/tree/new-gallery-style Here's a rendered HTML page: https://output.circle-artifacts.com/output/job/5f05281c-5021-4c3c-ac1c-438970164658/artifacts/0/html/subdir/gallery.html I think for this change it makes sense to finally split the CSS into separate files, see spatialaudio#667. |
Thanks a lot for your suggestions!
Yeah, I think I agree with that. I've created a new commit to try that: 423067a
I'm not sure if I agree with that. But maybe I'm wrong, I'm still open for suggestions!
I've used |
Thanks for incorporating this, its looking good! And you are right, the top-alignment is cleaner. |
Thanks for the feedback! It'll take some time util I'll release this, though. I first want to make a release with another gallery-related feature (spatialaudio#696) and a few HTML theme updates. After that I'll start working on spatialaudio#667. |
OK, this went faster than I thought ... I've already made a new release and I've created a PR: spatialaudio#706 Feel free to suggest some more CSS fine-tuning there! |
I have merged spatialaudio#706, so this is not needed anymore. |
Awesome thanks a lot! And sorry for not giving extra feedback for the CSS, but it looks great to me, anyway! |
Thanks @mgeier for all the great work you put into nbsphinx!
If I understood sphinx-gallery/sphinx-gallery#984 correctly, this merge request would fix spatialaudio#655, and the only thing missing is backwards compatibility with sphinx-gallery pre v0.11.
As the solution is temporary anyway, would a simple conditional not suffice? It worked for my case in environments using sphinx-gallery 0.10.1 and sphinx-gallery 0.11.1 (The results did not look identical, but the behaviour for 0.11.1 was greatly improved...)
I would love to see this issue fixed without having to pin the version of sphinx gallery.