Set "simple" or "single document" mode as default

I just switch from jupyter notebook. I usually work always with single documents since I use jupyter mainly for data visualization, not for big projects.

It seems like a big improvement over jupyter notebook but I would like to use simple mode by default, instead of having to activate it every time I open a notebook.

Is there any way to do this?

Thanks in advance

1 Like

Yes, when you start jupyterlab you get a URL such as http://localhost:8888/lab. If you change it to http://localhost:8888/doc you get single document mode.

Also, you may like RetroLab: GitHub - jupyterlab/retrolab: JupyterLab distribution with a retro look and feel 🌅

1 Like

Thank you very much! That would work but it does not adapt to my workflow.

I usually launch jupyterlab just by double clicking jupyter-notebooks which trigger the binary jupyter-lab %f (so I don’t get the terminal output).

This opens form me (for example) the http://localhost:8923/lab/tree/CsV3Sb5.ipynb URL, I would like to load http://localhost:8923/doc/tree/CsV3Sb5.ipynb by default. I don’t see any kind of flat in jupyter-lab --help for doing so…

What about jupyter-lab --LabApp.default_url='/doc'?

If that works you can set in the a config file so that it apply automatically.

It works when you type it alone, you get to the launch menu, but if you type:

jupyter-lab --LabApp.default_url='/doc' file

Then it opens still with /lab URL

Indeed. I think that jupyter-lab --ServerApp.file_url_prefix='/doc/tree' Untitled.ipynb should work in this case, but file_url_prefix is hard-coded and not a trait, so it does not. I guess that someone would need to make a pull request to change:

to look like this:

1 Like

Though the beauty of jupyter-server is that you can skip jupyter lab server and open it on the server level: jupyter server --ServerApp.file_url_prefix='/doc/tree' --ServerApp.open_browser=True Untitled.ipynb.

But I would not rely on this in the long term; it does not allow you to configure lab-specific things such as enabling --collaborative mode easily. Also I do not know what is the alias for jupyter server on Windows; I guess jupyter-server?

Instead I really recommend contributing by submitting a pull request to make the hard-coded value configurable. I’m happy to help if that would be your first pull request - in that case let me know and I would explain how to proceed.

1 Like