Closed BoPeng closed 3 years ago
A patch has been pushed basically, you will need to
pip install -e .
python -m sos_notebook.install
. The output of this command will let you know the location of a configuration file."sos_notebook_console_panel": "auto"
to
"sos_notebook_console_panel": "false"
Then start jupyter notebook.
Remaining problems:
@csemken Please let me know if this works for you.
Thank you @BoPeng!
Turning the panel off via the configuration file works. However, while the panel disappears, it leaves a blank void to the left of the notebook container (see below). This is the same in presentation mode, so that it doesn’t fix the original problem unfortunately.
I had a quick look at where this comes from. At the end of the toggle the width of the container is $("#notebook").width() - 40
but then suddenly the width and margin-left are reset in this timeout.
Would it be possible to fix this? Toggling the console via the button works as expect, so maybe a quick fix could be to just execute the initial toggle a bit later?
This is the 2nd problem I talked about. I will try to restore the location to the default (center with large margins) when the panel is hidden.
@csemken Could you test the console_css
branch and let me know if it works for you?
@csemken Could you test the
console_css
branch and let me know if it works for you?
It works! See screenshots below for the presenter view and decktape-generated pdf. Thank you so much!
I do have one small additional suggestion, although the current solution works perfectly and so is sufficient for my purposes.
I noticed that you save the state of the console in the notebook’s metadata as nb.metadata["sos"]["panel"].displayed
. Would it be difficult to use this variable to decide if the console should be shown when sos_notebook_console_panel
is set to auto
?
This would allow users to turn the panel off (permanently) for individual notebooks.
It is also how the built-in TOC sidebar works: toggling it changes the value of nb.metadata["toc"].toc_window_display
and the side bar is shown when the notebook is loaded if this variable is set to true
.
Will do, but then the configuration option is not needed, right? All you need to do is to create the notebook, turn off console panel, save it, and open again for presentation.
Pushed another change to enable this. As I said, this makes the configuration option less useful since you can simple close the console panel, save, and the notebook will be opened next time without console panel.
I will keep the mechanism though since it can be used later to configure things such as shortcuts.
Pushed another change to enable this.
Thank you @BoPeng. I just tested it and it works perfectly.
As I said, this makes the configuration option less useful since you can simple close the console panel, save, and the notebook will be opened next time without console panel.
For this particular application, yes. Sorry I didn’t think of this earlier, it occurred to me yesterday. I hope it wasn’t too much extra work.
I will keep the mechanism though since it can be used later to configure things such as shortcuts.
Great. I also think it is useful to be able to turn the panel off globally. I, for one, don’t currently use it in my workflow.
I have merged the branch and released sos notebook 0.22.5.
@csemken on gitter