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

Allow for removal some widgets from notebook output #20

Open
mlucool opened this issue Oct 24, 2024 · 0 comments
Open

Allow for removal some widgets from notebook output #20

mlucool opened this issue Oct 24, 2024 · 0 comments

Comments

@mlucool
Copy link
Member

mlucool commented Oct 24, 2024

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".

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

No branches or pull requests

1 participant