-
Notifications
You must be signed in to change notification settings - Fork 27
Add a loading spinner for TryExamples directive. #133
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
Conversation
I've deployed SciPy's docs built against this feature branch. You can check out the spinner in action here https://steppi.github.io/scipy/reference/generated/scipy.stats.kurtosistest.html#scipy.stats.kurtosistest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried the link you pointed to, looks great!!
It seems the spinner is not centered on the iframe, which is odd given the CSS you apply (absolute positioning + width 50% and height 50%), not sure what's wrong.
@martinRenou, I've added the spinner for the other directives too. I also see what you mean now about the spinner not being centered. If we have left and top at 50% then the top and left are in the center and we need to add negative margins to actually center the spinner. I've also changed how the spinner is placed for the try examples directive to put it in the center if the center is in view, otherwise halfway between the top of the iframe and the bottom of the viewport. |
SciPy docs incorporating the updates are up now: https://steppi.github.io/scipy/reference/generated/scipy.stats.kurtosistest.html#scipy.stats.kurtosistest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Closes #120
This PR adds a loading spinner for the TryExamples directive. I've offered no options to customize the spinner because I don't have sufficient time to think about how to do that cleanly and document it properly. My goal is just to get this working before submitting a PR adding interactive docs to SciPy. We can revisit later.
I've also fixed a bug where I was referring to a configuration variable which no longer exists (it only occurs when
global_enable_try_examples = True
), and I've added a link totry_examples.css
in the try examples documentation to make it easier for readers to find that file.