Skip to content

Allow for removal some widgets from notebook output #20

Open
@mlucool

Description

Given a notebook that looks like:

# %%
from ipywidgets import Output
o = Output()
o

# %%
with o:
    print('hi')

It will save something like this to the notebook:

   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "3bdcd203b4624d669a8b001aabf58416",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Output()"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],

We'd still like to be able to strip these unusable output areas (assuming widget state isn't autosaved). This is complex as vnd.jupyter.widget-view+json is used for all jupyter widgets. Ideally, it would be something like "if its an execute_result and data has type vnd.jupyter.widget-view+json, look at "text/plain" and evaluate a regex to determine if we should strip this".

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions