extensions.rst 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719
  1. .. _user_extensions:
  2. Extensions
  3. ----------
  4. Fundamentally, JupyterLab is designed as an extensible environment. JupyterLab
  5. extensions can customize or enhance any part of JupyterLab. They can provide new
  6. themes, file viewers and editors, or renderers for rich outputs in notebooks.
  7. Extensions can add items to the menu or command palette, keyboard shortcuts, or
  8. settings in the settings system. Extensions can provide an API for other
  9. extensions to use and can depend on other extensions. In fact, the whole of
  10. JupyterLab itself is simply a collection of extensions that are no more powerful
  11. or privileged than any custom extension.
  12. .. contents:: Table of contents
  13. :local:
  14. :depth: 1
  15. JupyterLab extensions are `npm <https://www.npmjs.com/>`__ packages (the
  16. standard package format in Javascript development). You can search for the
  17. keyword `jupyterlab-extension
  18. <https://www.npmjs.com/search?q=keywords%3Ajupyterlab-extension>`__ on the
  19. npm registry to find extensions. For information about developing extensions,
  20. see the :ref:`developer documentation <developer_extensions>`.
  21. .. note::
  22. If you are a JupyterLab extension developer, please note that the extension
  23. developer API is not stable and will evolve in the near future.
  24. In order to install JupyterLab extensions, you need to have `Node.js
  25. <https://nodejs.org/>`__ installed.
  26. If you use ``conda``, you can get it with:
  27. .. code:: bash
  28. conda install -c conda-forge nodejs
  29. If you use `Homebrew <https://brew.sh/>`__ on Mac OS X:
  30. .. code:: bash
  31. brew install node
  32. You can also download Node.js from the `Node.js website <https://nodejs.org/>`__ and
  33. install it directly.
  34. Using the Extension Manager
  35. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  36. To manage your extensions, you can use the extension manager. By default, the
  37. manager is disabled. You can enable it by searching **Extension Manager** in the command palette.
  38. .. figure:: images/extension_manager_enable_manager.png
  39. :align: center
  40. :class: jp-screenshot
  41. **Figure:** Enable extension manager by searching in the command palette
  42. You can also enable it with the following steps:
  43. - Go into advanced settings editor.
  44. - Open the Extension Manager section.
  45. - Add the entry "enabled": true.
  46. - Save the settings.
  47. - If prompted whether you are sure, read the warning, and click "Enable"
  48. if you are still sure.
  49. Once enabled, you should see a new tab appear in the :ref:`left sidebar <left-sidebar>`.
  50. .. figure:: images/extension_manager_default.png
  51. :align: center
  52. :class: jp-screenshotls
  53. **Figure:** The default view has three components: a search bar, an "Installed"
  54. section, and a "Discover" section.
  55. Disclaimer
  56. ^^^^^^^^^^
  57. .. danger::
  58. Installing an extension allows it to execute arbitrary code on the
  59. server, kernel, and in the client's browser. Therefor we ask you
  60. to explictitly acknowledge this.
  61. By default, the disclaimer is not checked.
  62. .. figure:: images/listings/disclaimer_unchecked.png
  63. :align: center
  64. :class: jp-screenshot
  65. **Figure:** User has not checked the disclaimer
  66. As the disclaimer is not checked, you can search for an extension,
  67. but can not install it (no Install button is available).
  68. .. figure:: images/listings/disclaimer_unchecked_noinstall.png
  69. :align: center
  70. :class: jp-screenshot
  71. **Figure:** With Disclaimer unchecked, you can not install an extension
  72. To install an extensino, you first have to explicitly check the disclaimer.
  73. Once done, this will remain across sessions and the user does not have to
  74. check it again.
  75. .. figure:: images/listings/disclaimer_checked.png
  76. :align: center
  77. :class: jp-screenshot
  78. **Figure:** Disclaimer checked
  79. For ease of use, you can hide the disclaimer so it takes less space on
  80. your screen.
  81. .. figure:: images/listings/disclaimer_hidden.png
  82. :align: center
  83. :class: jp-screenshot
  84. **Figure:** Disclaimer is hidden
  85. Finding Extensions
  86. ^^^^^^^^^^^^^^^^^^
  87. You can use the extension manager to find extensions for JupyterLab. To discovery
  88. freely among the currently available extensions, expand the "Discovery" section.
  89. This triggers a search for all JupyterLab extensions on the NPM registry, and
  90. the results are listed according to the `registry's sort order
  91. <https://docs.npmjs.com/searching-for-and-choosing-packages-to-download#package-search-rank-criteria>`__.
  92. An exception to this sort order is that extensions released by the Jupyter
  93. organization are always placed first. These extensions are distinguished by
  94. a small Jupyter icon next to their name.
  95. .. image:: images/extension_manager_discover.png
  96. :align: center
  97. :class: jp-screenshot
  98. :alt: Screenshot showing the discovery extension listing.
  99. Alternatively, you can limit your discovery by using the search bar. This
  100. performs a free-text search of JupyterLab extensions on the NPM registry.
  101. .. image:: images/extension_manager_search.png
  102. :align: center
  103. :class: jp-screenshot
  104. :alt: Screenshot showing an example search result
  105. .. _listings:
  106. Installing an Extension
  107. ^^^^^^^^^^^^^^^^^^^^^^^
  108. Once you have found an extension that you think is interesting, install
  109. it by clicking the "Install" button of the extension list entry.
  110. .. danger::
  111. Installing an extension allows it to execute arbitrary code on the
  112. server, kernel, and in the client's browser. You should therefore
  113. avoid installing extensions you do not trust, and watch out for
  114. any extensions trying to masquerade as a trusted extension.
  115. A short while after starting the install of an extension, a drop-down should
  116. appear under the search bar indicating that the extension has been
  117. downloaded, but that a rebuild is needed to complete the installation.
  118. .. image:: images/extension_manager_rebuild.png
  119. :align: center
  120. :class: jp-screenshot
  121. :alt: Screenshot showing the rebuild indicator
  122. If you want to install/uninstall other extensions as well, you can ignore
  123. the rebuild notice until you have made all the changes you want. Once satisfied,
  124. click the 'Rebuild' button to start a rebuild in the background.
  125. Once the rebuild completes, a dialog will pop up, indicating that a reload of
  126. the page is needed in order to load the latest build into the browser.
  127. If you ignore the rebuild notice by mistake, simply refresh your browser
  128. window to trigger a new rebuild check.
  129. Disabling Rebuild Checks
  130. ~~~~~~~~~~~~~~~~~~~~~~~~
  131. In some cases, such as automated testing, you may wish to disable the startup
  132. rebuild checks altogether. This can be achieved through setting ``buildCheck``
  133. and ``buildAvailable`` in ``jupyter_notebook_config.json`` (or ``.py`` equivalent)
  134. in any of the ``config`` locations returned by ``jupyter --paths``.
  135. .. code:: json
  136. {
  137. "LabApp": {
  138. "tornado_settings": {
  139. "page_config_data": {
  140. "buildCheck": false,
  141. "buildAvailable": false,
  142. }
  143. }
  144. }
  145. }
  146. Managing Installed Extensions
  147. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  148. When there are some installed extensions, they will be shown in the "Installed"
  149. section. These can then be uninstalled or disabled. Disabling an extension will
  150. prevent it from being activated, but without rebuilding the application.
  151. Companion packages
  152. ^^^^^^^^^^^^^^^^^^
  153. During installation of an extension, JupyterLab will inspect the package
  154. metadata for any
  155. :ref:`instructions on companion packages <ext-author-companion-packages>`.
  156. Companion packages can be:
  157. - Notebook server extensions (or any other packages that need to be
  158. installed on the Notebook server).
  159. - Kernel packages. An example of companion packages for the
  160. kernel are Jupyter Widget packages, like the `ipywidgets <https://ipywidgets.readthedocs.io/en/stable>`__
  161. Python package for the
  162. `@jupyter-widgets/jupyterlab-manager package <https://www.npmjs.com/package/@jupyter-widgets/jupyterlab-manager>`__.
  163. If JupyterLab finds instructions for companion packages, it will present
  164. a dialog to notify you about these. These are informational only, and it
  165. will be up to you to take these into account or not.
  166. Listings
  167. ~~~~~~~~
  168. When searching extensions, JupyterLab displays the complete search result and
  169. the user if free to install any extension. This is the :ref:`default_mode`.
  170. To bring more security, you or your administrator can enable ``blacklists`` or ``whitelists``
  171. mode. JupyterLab will check the extensions against the defined listings.
  172. Only one mode at a time is allowed.
  173. The following details the behavior for the :ref:`blacklist_mode` and the :ref:`whitelist_mode`.
  174. The details to enable configure the listings can be read :ref:`listings_conf`.
  175. .. _default_mode:
  176. Default mode
  177. ^^^^^^^^^^^^
  178. In the ``default`` mode, no listing is enabled and the search behavior is unchanged and
  179. is the one described previously.
  180. .. _blacklist_mode:
  181. Blacklist mode
  182. ^^^^^^^^^^^^^^
  183. Extensions can be freely downloaded without going through a vetting process.
  184. However, users can add malicious extensions to a blacklist. The extension manager
  185. will show all extensions except for those that have
  186. been explicitly added to the blacklist. Therfore, the extension manager
  187. does not allow you to install blacklisted extensions.
  188. If you, or your administrator, has enabled the blacklist mode,
  189. JupyterLab will use the blacklist and remove all blacklisted
  190. extensions from your search result.
  191. If you have installed an extension before it has been blacklisted,
  192. the extension entry in the installed list will be highlighted
  193. in red. It is recommended that you uninstall it. You can move
  194. your mouse on the question mark icon to read the instructions.
  195. .. figure:: images/listings/installed_blacklisted.png
  196. :align: center
  197. :class: jp-screenshot
  198. **Figure:** Blacklisted installed extension which should be removed
  199. .. _whitelist_mode:
  200. Whitelist mode
  201. ^^^^^^^^^^^^^^
  202. A whitelist maintains a set of approved extensions that users can freely
  203. search and install. Extensions need to go through some sort of vetting process
  204. before they are added to the whitelist. When using a whitelist, the extension manager
  205. will highlight extensions that have been explicitly added to the whitelist.
  206. If you, or your administrator, has enabled the whitelist mode
  207. JupyterLab will use the whitelist and only show extensions present
  208. in the withelist. The other extensions will not be show in the search result.
  209. If you have installed an whitelisted extension and at some point
  210. in time that extension is removed from the whitelist, the extension entry
  211. in the installed list will be highlighted in red. It is recommended that
  212. you uninstall it. You can move your mouse on the question mark icon to
  213. read the instructions.
  214. .. figure:: images/listings/installed_whitelisted.png
  215. :align: center
  216. :class: jp-screenshot
  217. **Figure:** Whitelisted installed extension which should be removed
  218. .. _listings_conf:
  219. Listing Configuration
  220. ^^^^^^^^^^^^^^^^^^^^^
  221. You or your administrator can use the following traits to define the listings loading.
  222. - ``blacklist_uris``: A list of comma-separated URIs to get the blacklist
  223. - ``whitelist_uris``: A list of comma-separated URIs to get the whitelist
  224. - ``listings_refresh_ms``: The interval delay in milliseconds to refresh the lists
  225. - ``listings_request_options``: The optional kwargs to use for the listings HTTP requests
  226. For example, to enable blacklist, launch the server with ``--LabServerApp.blacklist_uris``.
  227. The details for the listings_request_options are listed
  228. on the `this page <https://2.python-requests.org/en/v2.7.0/api/#requests.request>`__
  229. (for example, you could pass ``{'timeout': 10}`` to change the HTTP request timeout value).
  230. The listings are json files hosted on the URIs you have given.
  231. This is an example of a blacklist file.
  232. .. code:: json
  233. {
  234. "blacklist": [
  235. {
  236. "name": "@jupyterlab-examples/launcher",
  237. "type": "jupyterlab",
  238. "reason": "@jupyterlab-examples/launcher is blacklisted for test purpose - Do NOT take this for granted!!!",
  239. "creation_date": "2020-03-11T03:28:56.782Z",
  240. "last_update_date": "2020-03-11T03:28:56.782Z"
  241. }
  242. ]
  243. }
  244. The ``name`` attribute support regular expressions.
  245. In the following whitelist example a ``@jupyterlab/*`` will whitelist
  246. all jupyterlab organization extensions.
  247. .. code:: json
  248. {
  249. "whitelistlist": [
  250. {
  251. "name": "@jupyterlab/*",
  252. "type": "jupyterlab",
  253. "reason": "@jupyterlab-examples/launcher is blacklisted for test purpose - Do NOT take this for granted!!!",
  254. "creation_date": "2020-03-11T03:28:56.782Z",
  255. "last_update_date": "2020-03-11T03:28:56.782Z"
  256. }
  257. ]
  258. }
  259. Using the Terminal
  260. ~~~~~~~~~~~~~~~~~~~~~
  261. Another way of managing your extensions is from the terminal on the server,
  262. using the ``jupyter labextension`` entry point. In general, a simple help text
  263. is available by typing ``jupyter labextension --help``.
  264. Installing Extensions
  265. ^^^^^^^^^^^^^^^^^^^^^
  266. You can install new extensions into the application
  267. using the command:
  268. .. code:: bash
  269. jupyter labextension install my-extension
  270. where ``my-extension`` is the name of a valid JupyterLab extension npm package
  271. on `npm <https://www.npmjs.com>`__. Use the ``my-extension@version``
  272. syntax to install a specific version of an extension, for example:
  273. .. code:: bash
  274. jupyter labextension install my-extension@1.2.3
  275. You can also install an extension that is not uploaded to npm, i.e.,
  276. ``my-extension`` can be a local directory containing the extension, a gzipped
  277. tarball, or a URL to a gzipped tarball.
  278. We encourage extension authors to add the ``jupyterlab-extension``
  279. GitHub topic to any repository with a JupyterLab extension to facilitate
  280. discovery. You can see a list of extensions by searching GitHub for the
  281. `jupyterlab-extension <https://github.com/search?utf8=%E2%9C%93&q=topic%3Ajupyterlab-extension&type=Repositories>`__
  282. topic.
  283. You can list the currently installed extensions by running the command:
  284. .. code:: bash
  285. jupyter labextension list
  286. Uninstall an extension by running the command:
  287. .. code:: bash
  288. jupyter labextension uninstall my-extension
  289. where ``my-extension`` is the name of the extension, as printed in the
  290. extension list. You can also uninstall core extensions using this
  291. command (you can always re-install core extensions later).
  292. Installing and uninstalling extensions can take some time, as they are
  293. downloaded, bundled with the core extensions, and the whole application
  294. is rebuilt. You can install/uninstall more than one extension in the
  295. same command by listing their names after the ``install`` command.
  296. If you are installing/uninstalling several extensions in several stages,
  297. you may want to defer rebuilding the application by including the flag
  298. ``--no-build`` in the install/uninstall step. Once you are ready to
  299. rebuild, you can run the command:
  300. .. code:: bash
  301. jupyter lab build
  302. **Note**
  303. If using Windows, you may encounter a `FileNotFoundError` due to the default PATH length on
  304. Windows. Node modules are stored in a nested file structure, so the path can get quite
  305. long. If you have administrative access and are on Windows 8 or 10, you can update the
  306. registry setting using these instructions: https://stackoverflow.com/a/37528731.
  307. Disabling Extensions
  308. ^^^^^^^^^^^^^^^^^^^^
  309. You can disable specific JupyterLab extensions (including core
  310. extensions) without rebuilding the application by running the command:
  311. .. code:: bash
  312. jupyter labextension disable my-extension
  313. This will prevent the extension from loading in the browser, but does not
  314. require a rebuild.
  315. You can re-enable an extension using the command:
  316. .. code:: bash
  317. jupyter labextension enable my-extension
  318. Advanced Usage
  319. ~~~~~~~~~~~~~~
  320. Any information that JupyterLab persists is stored in its application directory,
  321. including settings and built assets.
  322. This is separate from where the Python package is installed (like in ``site_packages``)
  323. so that the install directory is immutable.
  324. The application directory can be overridden using ``--app-dir`` in
  325. any of the JupyterLab commands, or by setting the ``JUPYTERLAB_DIR``
  326. environment variable. If not specified, it will default to
  327. ``<sys-prefix>/share/jupyter/lab``, where ``<sys-prefix>`` is the
  328. site-specific directory prefix of the current Python environment. You
  329. can query the current application path by running ``jupyter lab path``.
  330. Note that the application directory is expected to contain the JupyterLab
  331. static assets (e.g. `static/index.html`). If JupyterLab is launched
  332. and the static assets are not present, it will display an error in the console and in the browser.
  333. JupyterLab Build Process
  334. ^^^^^^^^^^^^^^^^^^^^^^^^
  335. To rebuild the app directory, run ``jupyter lab build``. By default, the
  336. ``jupyter labextension install`` command builds the application, so you
  337. typically do not need to call ``build`` directly.
  338. Building consists of:
  339. - Populating the ``staging/`` directory using template files
  340. - Handling any locally installed packages
  341. - Ensuring all installed assets are available
  342. - Bundling the assets
  343. - Copying the bundled assets to the ``static`` directory
  344. Note that building will always use the latest JavaScript packages that meet
  345. the dependency requirements of JupyterLab itself and any installed extensions.
  346. If you wish to run JupyterLab with the set of pinned requirements that was
  347. shipped with the Python package, you can launch as
  348. ``jupyter lab --core-mode``.
  349. **Note**
  350. The build process uses a specific ``yarn`` version with a default working
  351. combination of npm packages stored in a ``yarn.lock`` file shipped with
  352. JupyterLab. Those package source urls point to the default yarn registry.
  353. But if you defined your own yarn registry in yarn configuration, the
  354. default yarn registry will be replaced by your custom registry.
  355. If then you switch back to the default yarn registry, you will need to
  356. clean your ``staging`` folder before building:
  357. .. code:: bash
  358. jupyter lab clean
  359. jupyter lab build
  360. JupyterLab Application Directory
  361. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  362. The JupyterLab application directory contains the subdirectories
  363. ``extensions``, ``schemas``, ``settings``, ``staging``, ``static``, and
  364. ``themes``. The default application directory mirrors the location where
  365. JupyterLab was installed. For example, in a conda environment, it is in
  366. ``<conda_root>/envs/<env_name>/share/jupyter/lab``. The directory can be
  367. overridden by setting a ``JUPYTERLAB_DIR`` environment variable.
  368. It is not recommended to install JupyterLab in a root location (on Unix-like
  369. systems). Instead, use a conda environment or ``pip install --user jupyterlab``
  370. so that the application directory ends up in a writable location.
  371. Note: this folder location and semantics do *not* follow the standard Jupyter
  372. config semantics because we need to build a single unified application, and the
  373. default config location for Jupyter is at the user level (user's home directory).
  374. By explicitly using a directory alongside the currently installed JupyterLab,
  375. we can ensure better isolation between conda or other virtual environments.
  376. .. _extensions-1:
  377. extensions
  378. ''''''''''
  379. The ``extensions`` directory has the packed tarballs for each of the
  380. installed extensions for the app. If the application directory is not
  381. the same as the ``sys-prefix`` directory, the extensions installed in
  382. the ``sys-prefix`` directory will be used in the app directory. If an
  383. extension is installed in the app directory that exists in the
  384. ``sys-prefix`` directory, it will shadow the ``sys-prefix`` version.
  385. Uninstalling an extension will first uninstall the shadowed extension,
  386. and then attempt to uninstall the ``sys-prefix`` version if called
  387. again. If the ``sys-prefix`` version cannot be uninstalled, its plugins
  388. can still be ignored using ``ignoredPackages`` metadata in ``settings``.
  389. schemas
  390. '''''''
  391. The ``schemas`` directory contains `JSON
  392. Schemas <http://json-schema.org/>`__ that describe the settings used by
  393. individual extensions. Users may edit these settings using the
  394. JupyterLab Settings Editor.
  395. settings
  396. ''''''''
  397. The ``settings`` directory may contain ``page_config.json``, ``overrides.json``, and/or
  398. ``build_config.json`` files, depending on which configurations are
  399. set on your system.
  400. .. _page_configjson:
  401. page_config.json
  402. The ``page_config.json`` data is used to provide configuration data to the
  403. application environment.
  404. The following configurations may be present in this file:
  405. 1. ``terminalsAvailable`` identifies whether a terminal (i.e. ``bash/tsch``
  406. on Mac/Linux OR ``PowerShell`` on Windows) is available to be launched
  407. via the Launcher. (This configuration was predominantly required for
  408. Windows prior to PowerShell access being enabled in Jupyter Lab.) The
  409. value for this field is a Boolean: ``true`` or ``false``.
  410. 2. ``disabledExtensions`` controls which extensions should not load at all.
  411. 3. ``deferredExtensions`` controls which extensions should not load until
  412. they are required by something, irrespective of whether they set
  413. ``autoStart`` to ``true``.
  414. The value for the ``disabledExtensions`` and ``deferredExtensions`` fields
  415. are an array of strings. The following sequence of checks are performed
  416. against the patterns in ``disabledExtensions`` and ``deferredExtensions``.
  417. - If an identical string match occurs between a config value and a
  418. package name (e.g., ``"@jupyterlab/apputils-extension"``), then the
  419. entire package is disabled (or deferred).
  420. - If the string value is compiled as a regular expression and tests
  421. positive against a package name (e.g.,
  422. ``"disabledExtensions": ["@jupyterlab/apputils*$"]``), then the
  423. entire package is disabled (or deferred).
  424. - If an identical string match occurs between a config value and an
  425. individual plugin ID within a package (e.g.,
  426. ``"disabledExtensions": ["@jupyterlab/apputils-extension:settings"]``),
  427. then that specific plugin is disabled (or deferred).
  428. - If the string value is compiled as a regular expression and tests
  429. positive against an individual plugin ID within a package (e.g.,
  430. ``"disabledExtensions": ["^@jupyterlab/apputils-extension:set.*$"]``),
  431. then that specific plugin is disabled (or deferred).
  432. An example of a ``page_config.json`` file is:
  433. .. code:: json
  434. {
  435. "disabledExtensions": [
  436. "@jupyterlab/toc"
  437. ],
  438. "terminalsAvailable": false
  439. }
  440. .. _overridesjson:
  441. overrides.json
  442. You can override default values of the extension settings by
  443. defining new default values in an ``overrides.json`` file.
  444. So for example, if you would like
  445. to set the dark theme by default instead of the light one, an
  446. ``overrides.json`` file containing the following lines needs to be
  447. added in the application settings directory (by default this is the
  448. ``share/jupyter/lab/settings`` folder).
  449. .. code:: json
  450. {
  451. "@jupyterlab/apputils-extension:themes": {
  452. "theme": "JupyterLab Dark"
  453. }
  454. }
  455. .. _build_configjson:
  456. build_config.json
  457. The ``build_config.json`` file is used to track the local directories
  458. that have been installed using
  459. ``jupyter labextension install <directory>``, as well as core extensions
  460. that have been explicitly uninstalled. An example of a
  461. ``build_config.json`` file is:
  462. .. code:: json
  463. {
  464. "uninstalled_core_extensions": [
  465. "@jupyterlab/markdownwidget-extension"
  466. ],
  467. "local_extensions": {
  468. "@jupyterlab/python-tests": "/path/to/my/extension"
  469. }
  470. }
  471. staging and static
  472. ''''''''''''''''''
  473. The ``static`` directory contains the assets that will be loaded by the
  474. JupyterLab application. The ``staging`` directory is used to create the
  475. build and then populate the ``static`` directory.
  476. Running ``jupyter lab`` will attempt to run the ``static`` assets in the
  477. application directory if they exist. You can run
  478. ``jupyter lab --core-mode`` to load the core JupyterLab application
  479. (i.e., the application without any extensions) instead.
  480. themes
  481. ''''''
  482. The ``themes`` directory contains assets (such as CSS and icons) for
  483. JupyterLab theme extensions.
  484. JupyterLab User Settings Directory
  485. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  486. The user settings directory contains the user-level settings for Jupyter extensions.
  487. By default, the location is ``~/.jupyter/lab/user-settings/``, where ``~`` is the user's home directory. This folder is not in the JupyterLab application directory,
  488. because these settings are typically shared across Python environments.
  489. The location can be modified using the ``JUPYTERLAB_SETTINGS_DIR`` environment variable. Files are automatically created in this folder as modifications are made
  490. to settings from the JupyterLab UI. They can also be manually created. The files
  491. follow the pattern of ``<package_name>/<extension_name>.jupyterlab-settings``.
  492. They are JSON files with optional comments. These values take precedence over the
  493. default values given by the extensions, but can be overridden by an ``overrides.json``
  494. file in the application's settings directory.
  495. JupyterLab Workspaces Directory
  496. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  497. JupyterLab sessions always reside in a workspace. Workspaces contain the state
  498. of JupyterLab: the files that are currently open, the layout of the application
  499. areas and tabs, etc. When the page is refreshed, the workspace is restored.
  500. By default, the location is ``~/.jupyter/lab/workspaces/``, where ``~`` is the user's home directory. This folder is not in the JupyterLab application directory,
  501. because these files are typically shared across Python environments.
  502. The location can be modified using the ``JUPYTERLAB_WORKSPACES_DIR`` environment variable. These files can be imported and exported to create default "profiles",
  503. using the :ref:`workspace command line tool <url-workspaces-cli>`.