extensions.rst 26 KB

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