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

Bad interaction between "Collapsible Headings" and "Excercise" extensions #990

Closed
vinniec opened this issue May 16, 2017 · 3 comments · Fixed by #1169 or zenotech/zCFDSuperBuild#159

Comments

@vinniec
Copy link

vinniec commented May 16, 2017

If there are collapsed cells with the "Exercise" extension (1 or 2, is the same) within collapsed cells with the "Collapsible Headings" extension, if the latter is expanded, the previous one is also expanded and I have to press twice on the slider/[+] to re-hide the exercise.

@jcb91
Copy link
Member

jcb91 commented May 16, 2017

So on expanding the heading, the exercise solution is also revealed, is that it? Sounds likely, since each nbextension but reveals/hides cells as it thinks appropriate, without making any effort to check whether any other nbextension has hidden them.

I think just patching collapsible headings would be enough, however, this could cause problems if the exercise nbextension is disabled, but its metadata remains available, since there would then be no way to re-reveal the solutions once hidden by a collapsed heading...

@vinniec
Copy link
Author

vinniec commented May 16, 2017

So on expanding the heading, the exercise solution is also revealed, is that it?

Yes, it is correct

...since there would then be no way to re-reveal the solutions once hidden by a collapsed heading...

I do not know how extensions are made, but I think at this point it is possible to have problems either if you open the notebook without one of the two active extensions or even if the opposite happens (a Collapsible Heading cell inside an Exercise cell, but I have not tried).

For now I have chosen to use only collapsible headings, if it is not resolvable it can be circumvented through only this extension.

@jcb91
Copy link
Member

jcb91 commented Jul 22, 2017

I think at this point it is possible to have problems [...] even if the opposite happens (a Collapsible Heading cell inside an Exercise cell, but I have not tried)

Ah, true, I hadn't thought of that! I suspect it wouldn't make a huge amount of sense to have headings inside a solution, so perhaps we might enforce that to prevent the potential confusion of a heading hidden by an exercise, which hides other cells which are not part of the exercise 😕

Anyway, having thought about this a little more, I think perhaps it could be fixed by using the bootstrap hidden css class to hide exercise cells, rather than the jquery hide, so that the collapsible_headings show/reveal won't affect them, and vice versa...

jcb91 added a commit to jcb91/jupyter_contrib_nbextensions that referenced this issue Dec 6, 2017
rather than jquery show/hide, in order to play nicely with collapsible_headings
fixes ipython-contrib#990
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants