jupyterlite-sphinx icon indicating copy to clipboard operation
jupyterlite-sphinx copied to clipboard

A broken interactive example in the NumPy docs / add support for handling the `.. plot::` directive

Open agriyakhetarpal opened this issue 9 months ago • 0 comments

Description

Post the merge of numpy/numpy#26745, I found a broken example in the NumPy docs: https://numpy.org/devdocs/reference/generated/numpy.percentile.html

Reproduce

  1. Go to https://numpy.org/devdocs/reference/generated/numpy.percentile.html
  2. Scroll down to the "Examples" section
  3. Click on the "Try it in your browser" button
  4. Scroll down in the notebook to see that the plot in the docs did not generate

The issue here is that we don't handle the .. plot:: directive properly – in this case, Numpydoc converts it to a .. code-block:: python directive with the HTML documentation.

Tap to show more

NumPy percentile example in an interactive notebook in the NumPy documentation. The plot directive has been converted to a Python code block directive and makes its way into the notebook

Expected behavior

The code should be a part of the interactive notebook, and the additional plot should be displayed upon running it

Context

  • JupyterLite version: N/a
  • Operating System and version: N/A
  • Browser and version: N/A
Browser Output

N/A

agriyakhetarpal avatar Jan 29 '25 20:01 agriyakhetarpal