jupyterlite / jupyterlite-sphinx

Sphinx extension using JupyterLite to render Notebooks
https://jupyterlite-sphinx.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
68 stars 21 forks source link

Add processing of literal blocks in try examples directive #134

Closed steppi closed 9 months ago

steppi commented 9 months ago

This PR adds support for processing literal blocks when converting RST to notebooks in the TryExamplesDirective. I noticed these weren't being handled correctly while going over locally built SciPy docs carefully in preparation for submitting a PR to SciPy. Screenshot below of what can go wrong when literal blocks aren't handled correctly. I'll post a link to this example after this fix is in once it finishes building and is deployed.

image

steppi commented 9 months ago

This isn't quite working yet. Still some edge cases to work out. Marking as draft.

steppi commented 9 months ago

It's working now. Here's a link https://steppi.github.io/scipy/reference/generated/scipy.integrate.quad.html#scipy.integrate.quad. I didn't correctly handle the case where a literal block directly follows another literal block.