Skip to content

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

@agriyakhetarpal

Description

@agriyakhetarpal

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions