Skip to content

Conversation

@steppi
Copy link
Collaborator

@steppi steppi commented Jan 31, 2024

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 to try_examples.css in the try examples documentation to make it easier for readers to find that file.

@steppi steppi added the enhancement New feature or request label Jan 31, 2024
@steppi
Copy link
Collaborator Author

steppi commented Feb 1, 2024

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

Copy link
Member

@martinRenou martinRenou left a 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.

@steppi
Copy link
Collaborator Author

steppi commented Feb 1, 2024

@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.

@steppi
Copy link
Collaborator Author

steppi commented Feb 1, 2024

Copy link
Member

@martinRenou martinRenou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@martinRenou martinRenou merged commit 2582889 into jupyterlite:main Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a spinner "Try example directive"

2 participants