What's the recommended way to automatically hide the toolbar and header in Jupyter Notebooks?

1,510 views
Skip to first unread message

Daniel Grady

unread,
Feb 18, 2016, 8:02:38 PM2/18/16
to Project Jupyter
I'd like to add something to my `.jupyter/custom/custom.js` so that the toolbar and header are hidden by default. I was trying to figure out what actually happens when you click on the View > Toggle Header menubar item, without much success. It seems that all of these commands in the console do what I want:

  • Jupyter.actions.call('jupyter-notebook:toggle-toolbar')
  • Jupyter.toolbar.actions.call('jupyter-notebook:toggle-toolbar')
  • Jupyter.toolbar.toggle()
Is one of these preferred? How would I accomplish this for the header as well? What actually happens when I click the item in the View menu?

Thanks for any suggestions!

– Daniel

Thomas Kluyver

unread,
Feb 19, 2016, 6:35:09 AM2/19/16
to Project Jupyter
On 19 February 2016 at 01:02, Daniel Grady <d.c....@gmail.com> wrote:
It seems that all of these commands in the console do what I want:
  • Jupyter.actions.call('jupyter-notebook:toggle-toolbar')
  • Jupyter.toolbar.actions.call('jupyter-notebook:toggle-toolbar')
  • Jupyter.toolbar.toggle()

The first two are probably exactly the same, just with different references to the same actions object. Actions are for binding UI elements and keyboard shortcuts to. They probably call the third one internally. For now, I'd guess that the action names are likely to be a bit more stable, so I'd go with that - the JS API is still liable to change.

Thomas

Brian Spiering

unread,
Apr 24, 2017, 3:02:44 PM4/24/17
to Project Jupyter
What is the equivalent command to "Toggle Header? Jupyter.actions.call('jupyter-notebook:toggle-header) doesn't work.

Brian Spiering

unread,
Apr 24, 2017, 3:03:54 PM4/24/17
to Project Jupyter
Sorry - I was missing a "`". Jupyter.actions.call('jupyter-notebook:toggle-header') works :)
Reply all
Reply to author
Forward
0 new messages