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

Try out sphinx-exercise for exercise formatting #5

Closed
wants to merge 2 commits into from
Closed

Conversation

scottyhq
Copy link
Owner

https://ebp-sphinx-exercise.readthedocs.io/en/latest/ This allows nice formatting and referencing of exercises on the rendered website. I tested things out with https://tutorial.xarray.dev/fundamentals/02.3_aligning_data_objects.html#alignment-putting-data-on-the-same-grid

Unfortunately the more special myst and sphinx markup in .ipynb files can lead to somewhat odd appearance in JupyterLab. But I think requiring a bit of effort to reveal the solution is good to force thinking it through. Some screenshots below on how this looks unrendered and rendered:

Rendered: Current (left) and This PR (right):

Screen Shot 2022-06-17 at 3 48 49 PM

Code: What a user sees in JupyterLab (left), actual markdown (right)

Screen Shot 2022-06-17 at 3 50 29 PM

If solutions don't require code execution (variables from earlier in a given notebook), they could be rendered on an entirely separate page (reference/exercise_solutions.md)...

A more lightweight solution is just to have separate mardown cells with headers (###solution) and use the 'hide-output' metadata tag to reveal on the website

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant