You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thebe prevents cells with hide-cell tag from opening in Jupyter-book. "Click to show" does nothing. This is because the ID of the div is overwritten by shpinx-thebe, and the "click to show" button uses the original ID to toggle visibility.
Why do we need to change this codeCell.id? Can we modify only the id of non-hidden cells?
I would happily try to submit a PR if needed :)
PS: in https://jupyterbook.org/interactive/thebe.html, an example is provided with a hide-input cell. This works because the corresponding HTML element has class cell-input and not class cell (like hide-cell tag), and thus its id is not modified.
The text was updated successfully, but these errors were encountered:
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
@fortierq thanks for opening this one up - I think that your diagnosis is correct that we are overwriting and ID. I think that we could try:
If a cell already has an ID, then we don't assign it a new one. If we can confirm that the behavior still works the same way, then maybe we are fine to stop there.
Describe the bug
Thebe prevents cells with hide-cell tag from opening in Jupyter-book. "Click to show" does nothing. This is because the ID of the
div
is overwritten byshpinx-thebe
, and the "click to show" button uses the original ID to toggle visibility.To Reproduce
Steps to reproduce the behavior:
Expected behavior
"Click to show" should show the hidden cell.
Environment
jupyter-book --version
: 0.11.1Additional context
The following line of code change the id of an hidden cell, preventing to toggle its hidden status:
sphinx-thebe/sphinx_thebe/_static/sphinx-thebe.js
Lines 62 to 65 in 53c098b
Why do we need to change this codeCell.id? Can we modify only the id of non-hidden cells?
I would happily try to submit a PR if needed :)
PS: in https://jupyterbook.org/interactive/thebe.html, an example is provided with a hide-input cell. This works because the corresponding HTML element has class cell-input and not class cell (like hide-cell tag), and thus its id is not modified.
The text was updated successfully, but these errors were encountered: