interface.rst 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. .. _interface:
  2. The JupyterLab Interface
  3. ------------------------
  4. JupyterLab provides flexible building blocks for interactive,
  5. exploratory computing. While JupyterLab has many features found in
  6. traditional integrated development environments (IDEs), it remains
  7. focused on interactive, exploratory computing.
  8. The JupyterLab interface consists of a :ref:`main work area <main-area>`
  9. containing tabs of documents and activities, a collapsible :ref:`left sidebar
  10. <left-sidebar>`, and a :ref:`menu bar <menu-bar>`. The left sidebar contains a
  11. :ref:`file browser <working-with-files>`, the :ref:`list of running kernels and
  12. terminals <running>`, the :ref:`command palette <commands>`, the :ref:`notebook
  13. cell tools inspector <notebook>`, and the :ref:`tabs list <tabs>`.
  14. .. image:: images/interface_jupyterlab.png
  15. :align: center
  16. :class: jp-screenshot
  17. .. _menu-bar:
  18. Menu Bar
  19. ~~~~~~~~
  20. The menu bar at the top of JupyterLab has top-level menus that expose
  21. actions available in JupyterLab with their keyboard shortcuts. The
  22. default menus are:
  23. - **File**: actions related to files and directories
  24. - **Edit**: actions related to editing documents and other activities
  25. - **View**: actions that alter the appearance of JupyterLab
  26. - **Run**: actions for running code in different activities such as
  27. notebooks and code consoles
  28. - **Kernel**: actions for managing kernels, which are separate processes
  29. for running code
  30. - **Tabs**: a list of the open documents and activities in the dock panel
  31. - **Settings**: common settings and an advanced settings editor
  32. - **Help**: a list of JupyterLab and kernel help links
  33. :ref:`JupyterLab extensions <user_extensions>` can also create new top-level menus in the menu
  34. bar.
  35. .. _left-sidebar:
  36. Left Sidebar
  37. ~~~~~~~~~~~~
  38. The left sidebar contains a number of commonly-used tabs, such as a file
  39. browser, a list of running kernels and terminals, the command palette,
  40. and a list of tabs in the main work area:
  41. .. image:: images/interface_left.png
  42. :align: center
  43. :class: jp-screenshot
  44. .. _left-sidebar-toggle:
  45. The left sidebar can be collapsed or expanded by selecting "Show Left Sidebar"
  46. in the View menu or by clicking on the active sidebar tab:
  47. .. raw:: html
  48. <div class="jp-youtube-video">
  49. <iframe src="https://www.youtube-nocookie.com/embed/PlJGecfetek?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  50. </div>
  51. JupyterLab extensions can add additional panels to the left sidebar.
  52. .. _main-area:
  53. Main Work Area
  54. ~~~~~~~~~~~~~~
  55. .. _main-area-vid:
  56. The main work area in JupyterLab enables you to arrange documents (notebooks,
  57. text files, etc.) and other activities (terminals, code consoles, etc.) into
  58. panels of tabs that can be resized or subdivided. Drag a tab to the center of a
  59. tab panel to move the tab to the panel. Subdivide a tab panel by dragging a tab to
  60. the left, right, top, or bottom of the panel:
  61. .. raw:: html
  62. <div class="jp-youtube-video">
  63. <iframe src="https://www.youtube-nocookie.com/embed/Ka8qS7CO1XQ?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  64. </div>
  65. The work area has a single current activity. The tab for the current activity is
  66. marked with a colored top border (blue by default).
  67. .. _tabs:
  68. Tabs and Single-Document Mode
  69. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  70. The Tabs panel in the left sidebar lists the open documents or
  71. activities in the main work area:
  72. .. image:: images/interface_tabs.png
  73. :align: center
  74. :class: jp-screenshot
  75. The same information is also available in the Tabs menu:
  76. .. image:: images/interface_tabs_menu.png
  77. :align: center
  78. :class: jp-screenshot
  79. .. _tabs-singledocument:
  80. It is often useful to focus on a single document or activity without closing
  81. other tabs in the main work area. Single-document mode enable this, while making
  82. it simple to return to your multi-activity layout in the main work area.
  83. Toggle single-document mode using the View menu:
  84. .. raw:: html
  85. <div class="jp-youtube-video">
  86. <iframe src="https://www.youtube-nocookie.com/embed/DO7NOenMQC0?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  87. </div>
  88. When you leave single-document mode, the original layout of the main
  89. area is restored.
  90. Context Menus
  91. ~~~~~~~~~~~~~
  92. .. _context-menus-rightclick:
  93. Many parts of JupyterLab, such as notebooks, text files, code consoles,
  94. and tabs, have context menus that can be accessed by right-clicking on
  95. the element:
  96. .. raw:: html
  97. <div class="jp-youtube-video">
  98. <iframe src="https://www.youtube-nocookie.com/embed/y30fs6kg6fc?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  99. </div>
  100. .. _context-menus-shiftrightclick:
  101. The browser’s native context menu can be accessed by holding down
  102. ``Shift`` and right-clicking:
  103. .. raw:: html
  104. <div class="jp-youtube-video">
  105. <iframe src="https://www.youtube-nocookie.com/embed/XPPWW-7WJ40?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  106. </div>
  107. .. _shortcuts:
  108. Keyboard Shortcuts
  109. ~~~~~~~~~~~~~~~~~~
  110. .. _shortcuts-settings:
  111. As in the classic Notebook, you can navigate the user interface through keyboard
  112. shortcuts. You can find and customize the current list of keyboard shortcuts by
  113. selecting the Advanced Settings Editor item in the Settings menu, then selecting
  114. Keyboard Shortcuts in the Settings tab.
  115. .. raw:: html
  116. <div class="jp-youtube-video">
  117. <iframe src="https://www.youtube-nocookie.com/embed/rhW3kAExCik?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  118. </div>
  119. .. _editor-keymaps:
  120. You can also customize the :ref:`text editor <file-editor>` to use vim, emacs, or Sublime Text
  121. keyboard maps by using the Text Editor Key Map submenu in the Settings
  122. menu:
  123. .. raw:: html
  124. <div class="jp-youtube-video">
  125. <iframe src="https://www.youtube-nocookie.com/embed/COheO7sA4-U?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  126. </div>
  127. .. _urls:
  128. URLs (``/tree``, ``/workspaces``, etc.)
  129. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  130. .. _url-tree:
  131. Like the classic notebook, JupyterLab provides a way for users to copy URLs that
  132. open a specific notebook or file. Additionally, JupyterLab URLs are an advanced
  133. part of the user interface that allows for managing workspaces. These two
  134. functions -- file paths and workspaces -- can be combined in URLs that open a
  135. specific file in a specific workspace. JupyterLab's file navigation URLS adopts
  136. the nomenclature of the classic notebook; these URLs are ``/tree`` URLs:
  137. .. code-block:: none
  138. http(s)://<server:port>/<lab-location>/lab/tree/path/to/notebook.ipynb
  139. .. _url-workspaces:
  140. JupyterLab sessions always reside in a *workspace*. Workspaces contain the state
  141. of JupyterLab: the files that are currently open, the layout of the application
  142. areas and tabs, etc. When the page is refreshed, the workspace is restored.
  143. The *default workspace* is not named, it is simply the main ``/lab`` URL:
  144. .. code-block:: none
  145. http(s)://<server:port>/<lab-location>/lab
  146. All other workspaces are named in the URL:
  147. .. code-block:: none
  148. http(s)://<server:port>/<lab-location>/lab/workspaces/foo
  149. http(s)://<server:port>/<lab-location>/lab/workspaces/bar
  150. http(s)://<server:port>/<lab-location>/lab/workspaces/baz
  151. Unlike the default (``/lab``) workspace, which only saves its state on the
  152. user's local browser, named workspaces save their state on the server, so a
  153. named workspace URL can be shared between multiple users (or browsers) as long
  154. as they have access to the same server.
  155. .. _url-clone:
  156. One useful feature of workspaces is the ability to ``clone`` the contents of a
  157. workspace into a new workspace.
  158. * To copy the contents of the workspace ``foo`` into the workspace ``bar``:
  159. ``/lab/workspaces/bar?clone=foo``
  160. * To copy the contents of the default workspace into the workspace ``foo``:
  161. ``/lab/workspaces/foo?clone``
  162. * To copy the contents of the workspace ``foo`` into the default workspace:
  163. ``/lab?clone=foo``
  164. .. _url-reset:
  165. If something goes wrong with a workspace, or if simply needs to be cleared of
  166. its contents, it can be ``reset``.
  167. * To reset the contents of the workspace ``foo`` :
  168. ``/lab/workspaces/foo?reset``
  169. * To reset the contents of the default workspace:
  170. ``/lab?reset``
  171. These URL functions can be used separately as above, or in combination, *e.g.*:
  172. * To reset the workspace ``foo`` and to load a specific notebook afterward:
  173. ``/lab/workspaces/foo/tree/path/to/notebook.ipynb?reset``
  174. * To clone the contents of the workspace ``bar`` into the workspace ``foo`` and
  175. to load a notebook afterward:
  176. ``/lab/workspaces/foo/tree/path/to/notebook.ipynb?clone=bar``
  177. * To reset the contents of the default workspace and to load a notebook:
  178. ``/lab/tree/path/to/notebook.ipynb?reset``