Notebook: Permanently disable header/toolbar

Created on 6 Aug 2016  路  11Comments  路  Source: jupyter/notebook

Hi, please provide option for user preference to permanently hide header/toolbar.

From my perspective header is useless to me - it contains Jupyter logo and Notebook title, which I already have in my browser tab. Although it's height is reduced compared to early versions, why waste valuable vertical space?

I made JS start script to auto disable header/toolbar, but with latest version this HTML element is probably changed, and it is not the first time it is changed. So instead digging inside HTML DOM and writing JS, I thought to write to you.

Thanks

Duplicate Question

Most helpful comment

@ggrrll My mistake, the PR for this feature (https://github.com/jupyter/notebook/issues/1769) is targeted for notebook version 5.0, so it is not available in 4.3.1. We are working towards a 5.0 release, so in a couple weeks you should have this feature 馃憤

All 11 comments

+1 for using other themes.

See https://github.com/ipython/ipython/issues/5623#issuecomment-40517625 for an example of how to modify custom.js to hide the header/menu.

@gnestor Have you tried the example you have linked?

FYI, it does not work in current version of Jupyter, and my point was to avoid rewriting JS for such obvious thing like removing useless elements from workspace which should be included by default or at least allow user to set the preference in some config file.

OTOH just take a look at various pycon videos that use Notebook - by default almost all use half screen as presentation workspace, because of these elements that are enabled by default.

As for the skins, thanks to @hainm for suggested workaround, but I don't want to use skins as I like the way Notebook looks.

@rornor The code I linked to is no longer compatible with the current version of the notebook. I've tested the following code and it works (if you're running 4.2.2, note https://github.com/jupyter/notebook/issues/1730 and put the code outside of 'app_initialized.NotebookApp' callback):

events.on('app_initialized.NotebookApp', function () {
    console.log('custom.js: hiding header and toolbar');
    $('#header-container').toggle();
    $('.header-bar').toggle();
    $('div#maintoolbar').toggle();
    events.trigger('resize-header.Page');
});

Screenshot:

screenshot

So, regarding your your issue:

  • You can obviously toggle the header and toolbar using the menu but this config is not persisted, so that the next time you open the same notebook or any other notebook, you will need to re-toggle.

    • However, toggle status can be persisted using nbconfig (this is used to persist line number toggle status on master). I will look into doing the same for header/toolbar toggle status...

  • You can customize the notebook UI using custom.js which offers users a lot of flexibility.

Thanks for you explanatory reply @gnestor

I just updated notebook to 4.2.3, and when I started new notebook, toolbars and headers are now hidden.

I would guess that the snippet you linked (that's the one I also used in the past) works with 4.2.3, and it does not work only on 4.2.2 (probably due to #1730)

@rornor Yes, 4.2.3 is just a patch for https://github.com/jupyter/notebook/issues/1730. Glad it's working! I am still working on persisting header/toolbar toggle status across notebook sessions. You can follow https://github.com/jupyter/notebook/pull/1769.

Thanks @gnestor for taking interest in this issue.

I just wanted to show reference to some random pycon video from my history: https://www.youtube.com/watch?v=M1-MVYLONZc&feature=youtu.be&t=32m00s

Presenter is not using slides but live Notebook. He doesn't even maximize his browser, and of course toolbars and headers are there, as perhaps he was busy with making presentation work, then making it's visual appearance best.

Hi,

as @gnestor suggested, version 4.3.1 should persist the user configuration, also after server restart.
How can I get that version?

After pip3.5 install -U jupyter or pip3.5 install notebook --upgrade
( suggested here )
I still have jupyer --version -> 4.2.1

Thanks

ps: which jupyter ->
/Library/Frameworks/Python.framework/Versions/3.5/bin/jupyter

@ggrrll jupyer --version returns the jupyter core version (4.2.1 is the latest). Try jupyter notebook --version.

Thanks... indeed it gives 4.3.1 but still, when I re-start the kernel it still re-open the toolbar and header
(I checked if it's a conflict with Nbexstensions and it seems not - I only _disable_ them all, not uninstalled)

(I am on macOS 10.12.2)

(I could get rid of toolbar and header with another jupyter theme ...but this is not really a solution)

@ggrrll My mistake, the PR for this feature (https://github.com/jupyter/notebook/issues/1769) is targeted for notebook version 5.0, so it is not available in 4.3.1. We are working towards a 5.0 release, so in a couple weeks you should have this feature 馃憤

Was this page helpful?
0 / 5 - 0 ratings