-
Notifications
You must be signed in to change notification settings - Fork 491
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
evaluating ipywidget code block in nbdev_preview does not result in output #1042
Comments
I'm having the same issue with ipywidget-enabled tqdm progress bars. |
Please open a new issue with full details to repro your problem -- adding to an existing issue means we don't have the info we need to help, and your issue won't be tracked separately. |
Discussion on forum |
I've reproduced this with a tiny example in quarto (no nbdev), tracking in the quarto repo: |
@tylere the upstream quarto issue is fixed in prerelease now - can you see if that helps? |
Wahoo! I now see the widget output in the preview! and they now show up on GitHub Pages: For completeness, here is the current versions of the libraries:
Thank you! I think it is fine to close this now. |
Yay! :D |
Looks like I was celebrating too soon... Example repo: https://github.com/tylere/test-evaluate-code-4 Here is the error I receive:
Here are the library versions used:
|
IIUC this is a bit of confusion between nbdev and Quarto's processors. When generating documentation, nbdev pre-processes the notebook before Quarto processes it. You can see the nbdev-processed version in the In this case: nbdev removes I'm not yet sure about the best solution.. Maybe nbdev could mark the cell as BTW, why is the |
I think it is needed... at least I don't know how to get the widgets to render correctly without it. But I would be happy to be corrected. According to the Quarto docs Output Options, the code block directives should override the frontmatter instructions. So maybe a solution is for nbdev to generate appropriate cell directives ( |
I *think* it is needed... at least I don't know how to get the widgets to render correctly without it. But I would be happy to be corrected.
My understanding is that it shouldn't be needed if you save the widget state, either with classic notebook's menu item, or lab's auto-save feature.
|
With JupyterLab's "Save Widget State Automatically" enabled, the UI does save the widget state, but then nbdev's default "Jupyter hook" behavior strips the widget state. If I set I can customize the notebook cleaning by setting |
#1069 is now fixed in latest master. |
This is currently labeled as "waiting for response" but I think that can be removed now. |
(This is a follow up to the Nbdev v2 & Jupyter Widgets discussion started on the nbdev forum.)
I am trying to get ipywidget output to render in nbdev_preview, with an eventual goal of getting it to render on GitHub pages. I am using (hopefully correctly) the master versions of nbdev, quarto, fastcore, execnb.
To reproduce:
Clone the test repository
https://github.com/tylere/test-evaluate-code-3
Setup a Local Environment setup
Prerelease dependency versions
View the output in JupyterLab
Preview the output
nbdev_preview
Note that the datetime printout rendered correctly, but the two ipywidgets do not render.
Clues
The nbdev_preview output warns "Malformed Jupyter Output Display Data found"
The text was updated successfully, but these errors were encountered: