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

Add more configuration options to TryExamples directive and add documentation #116

Merged
merged 12 commits into from
Dec 22, 2023

Conversation

steppi
Copy link
Collaborator

@steppi steppi commented Dec 20, 2023

This PR updates adds more flexible configuration for the TryExamples directive, fixes some small bugs, and adds documentation.

New options include

  • :button_text: for changing the text of the button for switching from rendered examples to a notebook.
  • :button_hover_css: for specifying the css properties to give to the button when the user hovers over it,
  • :button_position_vertical: one of top or bottom specifying vertical placement of the button with respect to the examples block covered by the directive.
  • :button_position_horizontal: one of left, right, or center, analogous to above.
  • :min_height:, the minimum height to give the iframe container for the notebook. By default, the height is the same as the height of the rendered examples block the container replaces. For very small examples blocks, this yields an unusably small notebook. :min_height: helps with this edge-case.

I noticed that the TryExamples directive had stopped working following the update to Jupyterlite 0.2 due to changes in paths; this has been fixed.

I've also fixed a bug that causes math blocks within markdown cells to be skipped if there is no additional content after them.

I've added documentation for the directive and how it can be configured. I note that one needs to make sure that the version of the package in your Jupyterlite kernel needs to match the version of the package you are documenting, but did not elaborate on this, because I haven't solved this problem yet. I've been testing this on the latest SciPy release. Eventually it would be nice to be able to use the directive in dev docs, and when that get's figured out, I'll add more information to the documentation.

@steppi
Copy link
Collaborator Author

steppi commented Dec 20, 2023

I just added conversion of sphinx format links link text <url> into markdown format [link text](url) after noticing the link didn't render correctly in the example in the docs.

I'll work on getting the SciPy docs published at https://steppi.github.io/scipy built against this branch. I ran out of circle ci free credits, so it's not as simple as a push. I'll figure something out. Things look good locally though.

@martinRenou martinRenou added the enhancement New feature or request label Dec 21, 2023
@martinRenou
Copy link
Member

Thanks a lot! Will try to give it a review by the end of the week

@steppi
Copy link
Collaborator Author

steppi commented Dec 21, 2023

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.

LGTM!

@martinRenou martinRenou merged commit b153587 into jupyterlite:main Dec 22, 2023
4 of 5 checks passed
@martinRenou
Copy link
Member

Released!

@steppi
Copy link
Collaborator Author

steppi commented Dec 22, 2023

Awesome! Thanks @martinRenou! Hoping to have this shipped in SciPy’s docs soon.

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.

2 participants