├── docs ├── source │ ├── _static │ │ ├── .gitkeep │ │ └── images │ │ │ ├── new-notebook.gif │ │ │ ├── cell-toolbar-41.png │ │ │ ├── dashboard-sort.png │ │ │ ├── find-replace-41.png │ │ │ ├── multi-select-41.png │ │ │ ├── shortcut-editor.png │ │ │ ├── blank-notebook-ui.png │ │ │ ├── cell-tags-toolbar.png │ │ │ ├── table-style-after.png │ │ │ ├── command-palette-41.png │ │ │ ├── jupyter-file-editor.png │ │ │ ├── table-style-before.png │ │ │ ├── jupyter-notebook-edit.png │ │ │ ├── notebook-running-code.png │ │ │ ├── jupyter-notebook-default.png │ │ │ └── jupyter-notebook-dashboard.png │ ├── examples │ │ ├── Notebook │ │ │ ├── nbpackage │ │ │ │ ├── __init__.py │ │ │ │ ├── nbs │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── other.ipynb │ │ │ │ └── mynotebook.ipynb │ │ │ ├── images │ │ │ │ ├── edit_mode.png │ │ │ │ ├── command_mode.png │ │ │ │ ├── menubar_toolbar.png │ │ │ │ ├── nbconvert_arch.png │ │ │ │ ├── dashboard_files_tab.png │ │ │ │ ├── dashboard_running_tab.png │ │ │ │ ├── dashboard_files_tab_btns.png │ │ │ │ ├── dashboard_files_tab_new.png │ │ │ │ └── dashboard_files_tab_run.png │ │ │ ├── examples_index.rst │ │ │ ├── Custom Keyboard Shortcuts.ipynb │ │ │ └── Connecting with the Qt Console.ipynb │ │ ├── images │ │ │ ├── animation.m4v │ │ │ ├── FrontendKernel.png │ │ │ ├── ipython_logo.png │ │ │ ├── jupyter_logo.png │ │ │ └── FrontendKernel.graffle │ │ │ │ └── image1.png │ │ └── utils │ │ │ ├── list_pyfiles.ipy │ │ │ └── list_subdirs.ipy │ ├── contributor.rst │ ├── development_faq.rst │ ├── user-documentation.rst │ ├── configuration.rst │ ├── index.rst │ ├── extending │ │ ├── index.rst │ │ └── frontend_extensions.rst │ ├── template.tpl │ ├── spelling_wordlist.txt │ ├── ui_components.rst │ ├── links.txt │ ├── config_overview.rst │ └── ipython_security.asc ├── resources │ ├── ipynb.icns │ ├── running_code_med.png │ ├── ipynb.iconset │ │ ├── icon_16x16.png │ │ ├── icon_24x24.png │ │ ├── icon_32x32.png │ │ ├── icon_48x48.png │ │ ├── icon_64x64.png │ │ ├── icon_128x128.png │ │ ├── icon_16x16@2x.png │ │ ├── icon_24x24@2x.png │ │ ├── icon_256x256.png │ │ ├── icon_32x32@2x.png │ │ ├── icon_512x512.png │ │ ├── icon_64x64@2x.png │ │ ├── icon_1024x1024.png │ │ ├── icon_128x128@2x.png │ │ ├── icon_256x256@2x.png │ │ └── icon_512x512@2x.png │ ├── Info.plist.example │ └── generate_icons.sh ├── doc-requirements.txt ├── environment.yml ├── jsdoc_config.json └── jsdoc_plugin.js ├── packages ├── ui-components │ ├── style │ │ ├── base.css │ │ ├── index.js │ │ └── index.css │ ├── babel.config.js │ ├── jest.config.js │ ├── src │ │ ├── index.ts │ │ ├── icon │ │ │ ├── index.ts │ │ │ └── iconimports.ts │ │ └── svg.d.ts │ ├── tsconfig.json │ ├── tsconfig.test.json │ ├── test │ │ └── foo.spec.ts │ └── package.json ├── console-extension │ ├── style │ │ ├── base.css │ │ ├── index.js │ │ └── index.css │ ├── tsconfig.json │ ├── package.json │ └── src │ │ └── index.ts ├── terminal-extension │ ├── style │ │ ├── base.css │ │ ├── index.js │ │ └── index.css │ ├── tsconfig.json │ ├── package.json │ └── src │ │ └── index.ts ├── documentsearch-extension │ ├── style │ │ ├── base.css │ │ ├── index.js │ │ └── index.css │ ├── tsconfig.json │ ├── schema │ │ └── notebookShellWidgetListener.json │ ├── package.json │ └── src │ │ └── index.ts ├── help-extension │ ├── style │ │ ├── index.js │ │ ├── index.css │ │ └── base.css │ ├── tsconfig.json │ ├── schema │ │ └── plugin.json │ └── package.json ├── lab-extension │ ├── style │ │ ├── index.js │ │ ├── index.css │ │ └── base.css │ ├── tsconfig.json │ ├── schema │ │ ├── launch-tree.json │ │ └── interface-switcher.json │ └── package.json ├── notebook-extension │ ├── style │ │ ├── index.js │ │ ├── index.css │ │ └── variables.css │ ├── tsconfig.json │ ├── schema │ │ ├── kernel-logo.json │ │ ├── checkpoints.json │ │ └── scroll-output.json │ └── package.json ├── docmanager-extension │ ├── style │ │ ├── index.js │ │ ├── index.css │ │ └── base.css │ ├── tsconfig.json │ ├── package.json │ └── src │ │ └── index.ts ├── tree │ ├── src │ │ ├── index.ts │ │ ├── token.ts │ │ └── notebook-tree.ts │ ├── style │ │ ├── index.js │ │ ├── index.css │ │ └── base.css │ ├── tsconfig.json │ └── package.json ├── application │ ├── babel.config.js │ ├── tsconfig.json │ ├── src │ │ └── index.ts │ ├── tsconfig.test.json │ ├── style │ │ ├── index.js │ │ ├── index.css │ │ └── base.css │ ├── jest.config.js │ ├── package.json │ └── test │ │ └── shell.spec.ts ├── tree-extension │ ├── style │ │ ├── index.js │ │ └── index.css │ ├── tsconfig.json │ ├── package.json │ └── schema │ │ └── widget.json ├── application-extension │ ├── style │ │ ├── index.js │ │ ├── index.css │ │ └── base.css │ ├── tsconfig.json │ ├── schema │ │ ├── title.json │ │ ├── zen.json │ │ ├── pages.json │ │ ├── top.json │ │ └── menus.json │ └── package.json └── _metapackage │ ├── src │ └── index.ts │ ├── tsconfig.json │ └── package.json ├── .prettierrc ├── app ├── style.js ├── webpack.config.watch.js └── publicpath.js ├── .github ├── jupyterlab-probot.yml ├── workflows │ ├── enforce-label.yml │ ├── binder.yml │ ├── lock.yml │ ├── docs.yml │ ├── check-release.yml │ ├── buildutils.yml │ ├── ui-tests.yml │ └── build.yml ├── answered.yml ├── ISSUE_TEMPLATE │ ├── config.yml │ └── bug_report.md └── actions │ └── build-dist │ └── action.yml ├── readthedocs.yml ├── notebook ├── __main__.py ├── __init__.py ├── _version.py └── templates │ ├── tree.html │ ├── edit.html │ ├── error.html │ ├── terminals.html │ ├── consoles.html │ └── notebooks.html ├── lerna.json ├── ui-tests ├── tsconfig.test.json ├── test │ ├── mobile.spec.ts-snapshots │ │ ├── tree-firefox-linux.png │ │ ├── tree-chromium-linux.png │ │ ├── notebook-chromium-linux.png │ │ └── notebook-firefox-linux.png │ ├── general.spec.ts-snapshots │ │ ├── notebook-firefox-linux.png │ │ └── notebook-chromium-linux.png │ ├── menus.spec.ts-snapshots │ │ ├── opened-menu-run-firefox-linux.png │ │ ├── opened-menu-edit-chromium-linux.png │ │ ├── opened-menu-edit-firefox-linux.png │ │ ├── opened-menu-file-chromium-linux.png │ │ ├── opened-menu-file-firefox-linux.png │ │ ├── opened-menu-help-chromium-linux.png │ │ ├── opened-menu-help-firefox-linux.png │ │ ├── opened-menu-run-chromium-linux.png │ │ ├── opened-menu-view-chromium-linux.png │ │ ├── opened-menu-view-firefox-linux.png │ │ ├── opened-menu-file-new-firefox-linux.png │ │ ├── opened-menu-kernel-chromium-linux.png │ │ ├── opened-menu-kernel-firefox-linux.png │ │ ├── opened-menu-settings-firefox-linux.png │ │ ├── opened-menu-file-new-chromium-linux.png │ │ ├── opened-menu-settings-chromium-linux.png │ │ ├── opened-menu-settings-theme-chromium-linux.png │ │ ├── opened-menu-settings-theme-firefox-linux.png │ │ ├── opened-menu-file-save-and-export-notebook-as…-firefox-linux.png │ │ └── opened-menu-file-save-and-export-notebook-as…-chromium-linux.png │ ├── settings.spec.ts-snapshots │ │ ├── top-hidden-chromium-linux.png │ │ ├── top-hidden-firefox-linux.png │ │ ├── top-visible-chromium-linux.png │ │ └── top-visible-firefox-linux.png │ ├── fixtures.ts │ ├── notebooks │ │ ├── simple.ipynb │ │ ├── empty.ipynb │ │ └── autoscroll.ipynb │ ├── jupyter_server_config.py │ ├── utils.ts │ ├── general.spec.ts │ ├── tree.spec.ts │ ├── settings.spec.ts │ ├── menus.spec.ts │ ├── mobile.spec.ts │ ├── editor.spec.ts │ ├── smoke.spec.ts │ └── notebook.spec.ts ├── playwright.config.ts └── package.json ├── .prettierignore ├── .git-blame-ignore-revs ├── setup.py ├── jupyter-config └── jupyter_server_config.d │ └── notebook.json ├── codecov.yml ├── jupyter_config.json ├── .eslintrc.json ├── .flake8 ├── binder ├── environment.yml └── postBuild ├── .eslintignore ├── tsconfig.eslint.json ├── RELEASE.md ├── .bumpversion.cfg ├── tsconfig.test.json ├── tsconfigbase.json ├── tsconfigbase.test.json ├── tests ├── test_app.py └── conftest.py ├── .eslintrc.js ├── .gitpod.yml ├── .pre-commit-config.yaml ├── .gitignore ├── LICENSE ├── package.json ├── pyproject.toml └── CONTRIBUTING.md /docs/source/_static/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/ui-components/style/base.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/console-extension/style/base.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/terminal-extension/style/base.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/documentsearch-extension/style/base.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /docs/source/examples/Notebook/nbpackage/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/source/examples/Notebook/nbpackage/nbs/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/style.js: -------------------------------------------------------------------------------- 1 | import '@jupyterlab/celltags/style/index.js'; 2 | -------------------------------------------------------------------------------- /packages/help-extension/style/index.js: -------------------------------------------------------------------------------- 1 | import './base.css'; 2 | -------------------------------------------------------------------------------- /packages/lab-extension/style/index.js: -------------------------------------------------------------------------------- 1 | import './base.css'; 2 | -------------------------------------------------------------------------------- /packages/console-extension/style/index.js: -------------------------------------------------------------------------------- 1 | import './base.css'; 2 | -------------------------------------------------------------------------------- /packages/notebook-extension/style/index.js: -------------------------------------------------------------------------------- 1 | import './base.css'; 2 | -------------------------------------------------------------------------------- /packages/terminal-extension/style/index.js: -------------------------------------------------------------------------------- 1 | import './base.css'; 2 | -------------------------------------------------------------------------------- /packages/console-extension/style/index.css: -------------------------------------------------------------------------------- 1 | @import url('./base.css'); 2 | -------------------------------------------------------------------------------- /packages/docmanager-extension/style/index.js: -------------------------------------------------------------------------------- 1 | import './base.css'; 2 | -------------------------------------------------------------------------------- /packages/documentsearch-extension/style/index.js: -------------------------------------------------------------------------------- 1 | import './base.css'; 2 | -------------------------------------------------------------------------------- /packages/help-extension/style/index.css: -------------------------------------------------------------------------------- 1 | @import url('./base.css'); 2 | -------------------------------------------------------------------------------- /packages/lab-extension/style/index.css: -------------------------------------------------------------------------------- 1 | @import url('./base.css'); 2 | -------------------------------------------------------------------------------- /packages/docmanager-extension/style/index.css: -------------------------------------------------------------------------------- 1 | @import url('./base.css'); 2 | -------------------------------------------------------------------------------- /packages/notebook-extension/style/index.css: -------------------------------------------------------------------------------- 1 | @import url('./base.css'); 2 | -------------------------------------------------------------------------------- /packages/terminal-extension/style/index.css: -------------------------------------------------------------------------------- 1 | @import url('./base.css'); 2 | -------------------------------------------------------------------------------- /packages/documentsearch-extension/style/index.css: -------------------------------------------------------------------------------- 1 | @import url('./base.css'); 2 | -------------------------------------------------------------------------------- /.github/jupyterlab-probot.yml: -------------------------------------------------------------------------------- 1 | addBinderLink: false 2 | triageLabel: "status:Needs Triage" 3 | -------------------------------------------------------------------------------- /packages/docmanager-extension/style/base.css: -------------------------------------------------------------------------------- 1 | .jp-Document { 2 | height: 100%; 3 | } 4 | -------------------------------------------------------------------------------- /packages/tree/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './notebook-tree'; 2 | export * from './token'; 3 | -------------------------------------------------------------------------------- /readthedocs.yml: -------------------------------------------------------------------------------- 1 | conda: 2 | file: docs/environment.yml 3 | python: 4 | version: 3 5 | -------------------------------------------------------------------------------- /docs/resources/ipynb.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/resources/ipynb.icns -------------------------------------------------------------------------------- /notebook/__main__.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | from notebook.app import main 4 | 5 | sys.exit(main()) 6 | -------------------------------------------------------------------------------- /packages/application/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@jupyterlab/testutils/lib/babel.config'); 2 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "npmClient": "yarn", 3 | "version": "independent", 4 | "useWorkspaces": true 5 | } 6 | -------------------------------------------------------------------------------- /packages/tree/style/index.js: -------------------------------------------------------------------------------- 1 | import '@jupyterlab/filebrowser/style/index.js'; 2 | 3 | import './base.css'; 4 | -------------------------------------------------------------------------------- /packages/ui-components/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@jupyterlab/testutils/lib/babel.config'); 2 | -------------------------------------------------------------------------------- /ui-tests/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfigbase.test", 3 | "include": ["test/**/*"] 4 | } 5 | -------------------------------------------------------------------------------- /docs/resources/running_code_med.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/resources/running_code_med.png -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | **/node_modules 3 | **/lib 4 | **/package.json 5 | **/static 6 | **/labextension 7 | build 8 | -------------------------------------------------------------------------------- /docs/doc-requirements.txt: -------------------------------------------------------------------------------- 1 | myst_parser 2 | nbsphinx 3 | pydata-sphinx-theme 4 | sphinx>=1.3.6 5 | sphinxcontrib_github_alt 6 | -------------------------------------------------------------------------------- /packages/tree/style/index.css: -------------------------------------------------------------------------------- 1 | @import url('~@jupyterlab/filebrowser/style/index.css'); 2 | 3 | @import url('./base.css'); 4 | -------------------------------------------------------------------------------- /docs/source/examples/images/animation.m4v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/examples/images/animation.m4v -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/resources/ipynb.iconset/icon_16x16.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_24x24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/resources/ipynb.iconset/icon_24x24.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/resources/ipynb.iconset/icon_32x32.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/resources/ipynb.iconset/icon_48x48.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/resources/ipynb.iconset/icon_64x64.png -------------------------------------------------------------------------------- /docs/source/_static/images/new-notebook.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/_static/images/new-notebook.gif -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # Run auto-formatters: https://github.com/jupyter/notebook/pull/6335 2 | a7717d90f128368296fe3434deba5acd6031edab 3 | -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/resources/ipynb.iconset/icon_128x128.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_16x16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/resources/ipynb.iconset/icon_16x16@2x.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_24x24@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/resources/ipynb.iconset/icon_24x24@2x.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/resources/ipynb.iconset/icon_256x256.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_32x32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/resources/ipynb.iconset/icon_32x32@2x.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/resources/ipynb.iconset/icon_512x512.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_64x64@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/resources/ipynb.iconset/icon_64x64@2x.png -------------------------------------------------------------------------------- /docs/source/_static/images/cell-toolbar-41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/_static/images/cell-toolbar-41.png -------------------------------------------------------------------------------- /docs/source/_static/images/dashboard-sort.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/_static/images/dashboard-sort.png -------------------------------------------------------------------------------- /docs/source/_static/images/find-replace-41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/_static/images/find-replace-41.png -------------------------------------------------------------------------------- /docs/source/_static/images/multi-select-41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/_static/images/multi-select-41.png -------------------------------------------------------------------------------- /docs/source/_static/images/shortcut-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/_static/images/shortcut-editor.png -------------------------------------------------------------------------------- /docs/source/examples/images/FrontendKernel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/examples/images/FrontendKernel.png -------------------------------------------------------------------------------- /docs/source/examples/images/ipython_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/examples/images/ipython_logo.png -------------------------------------------------------------------------------- /docs/source/examples/images/jupyter_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/examples/images/jupyter_logo.png -------------------------------------------------------------------------------- /packages/ui-components/jest.config.js: -------------------------------------------------------------------------------- 1 | const func = require('@jupyterlab/testutils/lib/jest-config'); 2 | module.exports = func(__dirname); 3 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # setup.py shim for use with versions of JupyterLab that require 2 | # it for extensions. 3 | __import__("setuptools").setup() 4 | -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_1024x1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/resources/ipynb.iconset/icon_1024x1024.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/resources/ipynb.iconset/icon_128x128@2x.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_256x256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/resources/ipynb.iconset/icon_256x256@2x.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_512x512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/resources/ipynb.iconset/icon_512x512@2x.png -------------------------------------------------------------------------------- /docs/source/_static/images/blank-notebook-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/_static/images/blank-notebook-ui.png -------------------------------------------------------------------------------- /docs/source/_static/images/cell-tags-toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/_static/images/cell-tags-toolbar.png -------------------------------------------------------------------------------- /docs/source/_static/images/table-style-after.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/_static/images/table-style-after.png -------------------------------------------------------------------------------- /packages/tree-extension/style/index.js: -------------------------------------------------------------------------------- 1 | import '@jupyterlab/filebrowser/style/index.js'; 2 | 3 | import '@jupyter-notebook/tree/style/index.js'; 4 | -------------------------------------------------------------------------------- /docs/source/_static/images/command-palette-41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/_static/images/command-palette-41.png -------------------------------------------------------------------------------- /docs/source/_static/images/jupyter-file-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/_static/images/jupyter-file-editor.png -------------------------------------------------------------------------------- /docs/source/_static/images/table-style-before.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/_static/images/table-style-before.png -------------------------------------------------------------------------------- /docs/source/examples/Notebook/images/edit_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/examples/Notebook/images/edit_mode.png -------------------------------------------------------------------------------- /docs/source/_static/images/jupyter-notebook-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/_static/images/jupyter-notebook-edit.png -------------------------------------------------------------------------------- /docs/source/_static/images/notebook-running-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/_static/images/notebook-running-code.png -------------------------------------------------------------------------------- /docs/source/examples/Notebook/images/command_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/examples/Notebook/images/command_mode.png -------------------------------------------------------------------------------- /docs/source/_static/images/jupyter-notebook-default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/_static/images/jupyter-notebook-default.png -------------------------------------------------------------------------------- /docs/source/examples/Notebook/images/menubar_toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/examples/Notebook/images/menubar_toolbar.png -------------------------------------------------------------------------------- /docs/source/examples/Notebook/images/nbconvert_arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/examples/Notebook/images/nbconvert_arch.png -------------------------------------------------------------------------------- /jupyter-config/jupyter_server_config.d/notebook.json: -------------------------------------------------------------------------------- 1 | { 2 | "ServerApp": { 3 | "jpserver_extensions": { 4 | "notebook": true 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docs/source/_static/images/jupyter-notebook-dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/_static/images/jupyter-notebook-dashboard.png -------------------------------------------------------------------------------- /packages/tree-extension/style/index.css: -------------------------------------------------------------------------------- 1 | @import url('~@jupyterlab/filebrowser/style/index.css'); 2 | 3 | @import url('~@jupyter-notebook/tree/style/index.css'); 4 | -------------------------------------------------------------------------------- /docs/source/examples/Notebook/images/dashboard_files_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/examples/Notebook/images/dashboard_files_tab.png -------------------------------------------------------------------------------- /docs/source/examples/images/FrontendKernel.graffle/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/examples/images/FrontendKernel.graffle/image1.png -------------------------------------------------------------------------------- /ui-tests/test/mobile.spec.ts-snapshots/tree-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/mobile.spec.ts-snapshots/tree-firefox-linux.png -------------------------------------------------------------------------------- /docs/source/examples/Notebook/images/dashboard_running_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/examples/Notebook/images/dashboard_running_tab.png -------------------------------------------------------------------------------- /ui-tests/test/mobile.spec.ts-snapshots/tree-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/mobile.spec.ts-snapshots/tree-chromium-linux.png -------------------------------------------------------------------------------- /docs/source/examples/Notebook/images/dashboard_files_tab_btns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/examples/Notebook/images/dashboard_files_tab_btns.png -------------------------------------------------------------------------------- /docs/source/examples/Notebook/images/dashboard_files_tab_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/examples/Notebook/images/dashboard_files_tab_new.png -------------------------------------------------------------------------------- /docs/source/examples/Notebook/images/dashboard_files_tab_run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/docs/source/examples/Notebook/images/dashboard_files_tab_run.png -------------------------------------------------------------------------------- /packages/application-extension/style/index.js: -------------------------------------------------------------------------------- 1 | import '@jupyter-notebook/application/style/index.js'; 2 | import '@lumino/widgets/style/index.js'; 3 | 4 | import './base.css'; 5 | -------------------------------------------------------------------------------- /packages/ui-components/src/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | export * from './icon'; 5 | -------------------------------------------------------------------------------- /ui-tests/test/general.spec.ts-snapshots/notebook-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/general.spec.ts-snapshots/notebook-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/mobile.spec.ts-snapshots/notebook-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/mobile.spec.ts-snapshots/notebook-chromium-linux.png -------------------------------------------------------------------------------- /ui-tests/test/mobile.spec.ts-snapshots/notebook-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/mobile.spec.ts-snapshots/notebook-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/general.spec.ts-snapshots/notebook-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/general.spec.ts-snapshots/notebook-chromium-linux.png -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | project: 4 | default: 5 | target: auto 6 | threshold: 10 7 | patch: 8 | default: 9 | target: 0% 10 | -------------------------------------------------------------------------------- /jupyter_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "LabApp": { "collaborative": true, "expose_app_in_browser": true }, 3 | "JupyterNotebookApp": { "collaborative": true, "expose_app_in_browser": true } 4 | } 5 | -------------------------------------------------------------------------------- /packages/ui-components/src/icon/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | export * from './iconimports'; 5 | -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-run-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/menus.spec.ts-snapshots/opened-menu-run-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/settings.spec.ts-snapshots/top-hidden-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/settings.spec.ts-snapshots/top-hidden-chromium-linux.png -------------------------------------------------------------------------------- /ui-tests/test/settings.spec.ts-snapshots/top-hidden-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/settings.spec.ts-snapshots/top-hidden-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/settings.spec.ts-snapshots/top-visible-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/settings.spec.ts-snapshots/top-visible-chromium-linux.png -------------------------------------------------------------------------------- /ui-tests/test/settings.spec.ts-snapshots/top-visible-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/settings.spec.ts-snapshots/top-visible-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-edit-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/menus.spec.ts-snapshots/opened-menu-edit-chromium-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-edit-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/menus.spec.ts-snapshots/opened-menu-edit-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-file-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/menus.spec.ts-snapshots/opened-menu-file-chromium-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-file-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/menus.spec.ts-snapshots/opened-menu-file-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-help-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/menus.spec.ts-snapshots/opened-menu-help-chromium-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-help-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/menus.spec.ts-snapshots/opened-menu-help-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-run-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/menus.spec.ts-snapshots/opened-menu-run-chromium-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-view-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/menus.spec.ts-snapshots/opened-menu-view-chromium-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-view-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/menus.spec.ts-snapshots/opened-menu-view-firefox-linux.png -------------------------------------------------------------------------------- /packages/application-extension/style/index.css: -------------------------------------------------------------------------------- 1 | @import url('~@jupyter-notebook/application/style/index.css'); 2 | @import url('~@lumino/widgets/style/index.css'); 3 | 4 | @import url('./base.css'); 5 | -------------------------------------------------------------------------------- /packages/application/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/notebook-extension/style/variables.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --jp-notebook-toolbar-margin-bottom: 20px; 3 | --jp-notebook-padding-offset: 20px; 4 | 5 | --jp-kernel-status-padding: 5px; 6 | } 7 | -------------------------------------------------------------------------------- /packages/ui-components/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"] 8 | } 9 | -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-file-new-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/menus.spec.ts-snapshots/opened-menu-file-new-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-kernel-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/menus.spec.ts-snapshots/opened-menu-kernel-chromium-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-kernel-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/menus.spec.ts-snapshots/opened-menu-kernel-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-settings-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/menus.spec.ts-snapshots/opened-menu-settings-firefox-linux.png -------------------------------------------------------------------------------- /packages/application/src/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | export * from './app'; 5 | export * from './shell'; 6 | -------------------------------------------------------------------------------- /packages/console-extension/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/help-extension/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/notebook-extension/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/terminal-extension/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"] 8 | } 9 | -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-file-new-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/menus.spec.ts-snapshots/opened-menu-file-new-chromium-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-settings-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/menus.spec.ts-snapshots/opened-menu-settings-chromium-linux.png -------------------------------------------------------------------------------- /packages/docmanager-extension/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/documentsearch-extension/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"] 8 | } 9 | -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-settings-theme-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/menus.spec.ts-snapshots/opened-menu-settings-theme-chromium-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-settings-theme-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/menus.spec.ts-snapshots/opened-menu-settings-theme-firefox-linux.png -------------------------------------------------------------------------------- /docs/source/contributor.rst: -------------------------------------------------------------------------------- 1 | =========== 2 | Contributor 3 | =========== 4 | 5 | .. toctree:: 6 | :maxdepth: 1 7 | :caption: Contributor Documentation 8 | 9 | contributing 10 | development_faq 11 | -------------------------------------------------------------------------------- /packages/application/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase.test", 3 | "include": ["src/**/*", "test/**/*"], 4 | "references": [ 5 | { 6 | "path": "." 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /packages/ui-components/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase.test", 3 | "include": ["src/**/*", "test/**/*"], 4 | "references": [ 5 | { 6 | "path": "." 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /packages/ui-components/src/svg.d.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | declare module '*.svg' { 5 | const value: string; 6 | export default value; 7 | } 8 | -------------------------------------------------------------------------------- /docs/source/examples/utils/list_pyfiles.ipy: -------------------------------------------------------------------------------- 1 | # A simple IPython script that provides Notebook links to .py files in the cwd 2 | 3 | from IPython.display import FileLink, display 4 | files =!ls *.py 5 | for f in files: 6 | display(FileLink(f)) 7 | -------------------------------------------------------------------------------- /ui-tests/playwright.config.ts: -------------------------------------------------------------------------------- 1 | import baseConfig from '@jupyterlab/galata/lib/playwright-config'; 2 | 3 | module.exports = { 4 | ...baseConfig, 5 | timeout: 240000, 6 | use: { 7 | appPath: '' 8 | }, 9 | retries: 1 10 | }; 11 | -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-file-save-and-export-notebook-as…-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/menus.spec.ts-snapshots/opened-menu-file-save-and-export-notebook-as…-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-file-save-and-export-notebook-as…-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Atcold/notebook/main/ui-tests/test/menus.spec.ts-snapshots/opened-menu-file-save-and-export-notebook-as…-chromium-linux.png -------------------------------------------------------------------------------- /docs/source/examples/utils/list_subdirs.ipy: -------------------------------------------------------------------------------- 1 | # A simple IPython script that lists files in all subdirs 2 | 3 | from IPython.display import FileLinks, display 4 | dirs =!ls -d */ 5 | for d in dirs: 6 | if d != '__pycache__/': 7 | display(FileLinks(d)) 8 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parserOptions": { 3 | "ecmaVersion": 6, 4 | "sourceType": "module" 5 | }, 6 | "rules": { 7 | "semi": 1, 8 | "no-cond-assign": 2, 9 | "no-debugger": 2, 10 | "comma-dangle": 0, 11 | "no-unreachable": 2 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/source/development_faq.rst: -------------------------------------------------------------------------------- 1 | .. _development_faq: 2 | 3 | Developer FAQ 4 | ============= 5 | 6 | 1. How do I install a prerelease version such as a beta or release candidate? 7 | 8 | .. code-block:: bash 9 | 10 | python -m pip install notebook --pre --upgrade 11 | -------------------------------------------------------------------------------- /docs/source/user-documentation.rst: -------------------------------------------------------------------------------- 1 | ================== 2 | User Documentation 3 | ================== 4 | 5 | .. toctree:: 6 | :maxdepth: 2 7 | 8 | notebook 9 | ui_components 10 | examples/Notebook/examples_index.rst 11 | troubleshooting 12 | changelog 13 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | ignore = E501, W503, E402 3 | builtins = c, get_config 4 | exclude = 5 | .cache, 6 | .github, 7 | docs, 8 | enable-extensions = G 9 | extend-ignore = 10 | G001, G002, G004, G200, G201, G202, 11 | # black adds spaces around ':' 12 | E203, 13 | -------------------------------------------------------------------------------- /packages/tree/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"], 8 | "references": [ 9 | { 10 | "path": "../application" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /binder/environment.yml: -------------------------------------------------------------------------------- 1 | name: notebook 2 | channels: 3 | - conda-forge 4 | dependencies: 5 | - ipywidgets=7.6 6 | - jupyterlab=3 7 | - jupyterlab-language-pack-fr-FR 8 | - jupyterlab-link-share>=0.2 9 | - matplotlib 10 | - numpy 11 | - nodejs 12 | - python >=3.9,<3.10 13 | - xeus-python 14 | -------------------------------------------------------------------------------- /packages/lab-extension/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"], 8 | "references": [ 9 | { 10 | "path": "../application" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | **/build 3 | **/lib 4 | **/node_modules 5 | **/mock_packages 6 | **/static 7 | **/typings 8 | **/schemas 9 | **/themes 10 | coverage 11 | *.map.js 12 | *.bundle.js 13 | 14 | # jetbrains IDE stuff 15 | .idea/ 16 | 17 | # ms IDE stuff 18 | .history/ 19 | .vscode/ 20 | -------------------------------------------------------------------------------- /packages/tree-extension/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"], 8 | "references": [ 9 | { 10 | "path": "../application" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /docs/source/configuration.rst: -------------------------------------------------------------------------------- 1 | ============= 2 | Configuration 3 | ============= 4 | 5 | .. toctree:: 6 | :maxdepth: 1 7 | :caption: Configuration 8 | 9 | config_overview 10 | Security 11 | extending/index.rst 12 | -------------------------------------------------------------------------------- /packages/application-extension/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"], 8 | "references": [ 9 | { 10 | "path": "../application" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfigbase", 3 | "include": [ 4 | "packages/**/*", 5 | "app/**/*", 6 | "buildutils/**/*", 7 | "ui-tests/**/*", 8 | "docs/**/*", 9 | ".eslintrc.js" 10 | ], 11 | "compilerOptions": { 12 | "types": ["jest"] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/application-extension/schema/title.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Title widget", 3 | "description": "Title widget", 4 | "jupyter.lab.toolbars": { 5 | "TopBar": [{ "name": "widgetTitle", "rank": 10 }] 6 | }, 7 | "properties": {}, 8 | "additionalProperties": false, 9 | "type": "object" 10 | } 11 | -------------------------------------------------------------------------------- /packages/ui-components/test/foo.spec.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | describe('foo', () => { 5 | describe('bar', () => { 6 | it('should pass', () => { 7 | expect(true).toBe(true); 8 | }); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /packages/notebook-extension/schema/kernel-logo.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Kernel logo", 3 | "description": "Kernel logo in the top area", 4 | "jupyter.lab.toolbars": { 5 | "TopBar": [{ "name": "kernelLogo", "rank": 110 }] 6 | }, 7 | "properties": {}, 8 | "additionalProperties": false, 9 | "type": "object" 10 | } 11 | -------------------------------------------------------------------------------- /packages/ui-components/style/index.js: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | | Copyright (c) Jupyter Development Team. 3 | | Distributed under the terms of the Modified BSD License. 4 | |----------------------------------------------------------------------------*/ 5 | 6 | import './base.css'; 7 | -------------------------------------------------------------------------------- /binder/postBuild: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | python -m pip install -e . --force-reinstall 5 | 6 | # TODO: remove when it's possible to install nbclassic next to Notebook v7 7 | # without nbclassic shadowing the v7 endpoints 8 | python -m pip uninstall nbclassic -y 9 | 10 | jlpm && jlpm run build 11 | jlpm run develop 12 | -------------------------------------------------------------------------------- /packages/ui-components/style/index.css: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | | Copyright (c) Jupyter Development Team. 3 | | Distributed under the terms of the Modified BSD License. 4 | |----------------------------------------------------------------------------*/ 5 | 6 | @import url('./base.css'); 7 | -------------------------------------------------------------------------------- /packages/notebook-extension/schema/checkpoints.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Notebook checkpoint indicator", 3 | "description": "Notebook checkpoint indicator", 4 | "jupyter.lab.toolbars": { 5 | "TopBar": [{ "name": "checkpoint", "rank": 20 }] 6 | }, 7 | "properties": {}, 8 | "additionalProperties": false, 9 | "type": "object" 10 | } 11 | -------------------------------------------------------------------------------- /ui-tests/test/fixtures.ts: -------------------------------------------------------------------------------- 1 | import { test as base } from '@jupyterlab/galata'; 2 | 3 | export const test = base.extend({ 4 | waitForApplication: async ({ baseURL }, use, testInfo) => { 5 | const waitIsReady = async (page): Promise => { 6 | await page.waitForSelector('#main-panel'); 7 | }; 8 | await use(waitIsReady); 9 | } 10 | }); 11 | -------------------------------------------------------------------------------- /ui-tests/test/notebooks/simple.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Test Notebook" 8 | ] 9 | } 10 | ], 11 | "metadata": { 12 | "language_info": { 13 | "name": "python" 14 | }, 15 | "orig_nbformat": 4 16 | }, 17 | "nbformat": 4, 18 | "nbformat_minor": 2 19 | } 20 | -------------------------------------------------------------------------------- /docs/environment.yml: -------------------------------------------------------------------------------- 1 | name: notebook_docs 2 | channels: 3 | - conda-forge 4 | dependencies: 5 | - python=3.8 6 | - pydata-sphinx-theme 7 | - jinja2 8 | - tornado 9 | - nbformat 10 | - jupyter_client 11 | - ipykernel 12 | - pip 13 | - sphinx 14 | - terminado 15 | - myst-parser 16 | - pip: 17 | - nbsphinx 18 | - Send2Trash 19 | - prometheus_client 20 | - sphinxcontrib_github_alt 21 | -------------------------------------------------------------------------------- /docs/jsdoc_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "markdown": { 3 | "parser": "gfm" 4 | }, 5 | "plugins": ["plugins/markdown", "jsdoc_plugin.js"], 6 | "source": { 7 | "include": ["../notebook/static/notebook/js/notebook.js"] 8 | }, 9 | "tags": { 10 | "allowUnknownTags": true 11 | }, 12 | "templates": { 13 | "cleverLinks": false, 14 | "monospaceLinks": false 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ui-tests/test/jupyter_server_config.py: -------------------------------------------------------------------------------- 1 | from tempfile import mkdtemp 2 | 3 | c.ServerApp.port = 8888 4 | c.ServerApp.port_retries = 0 5 | c.ServerApp.open_browser = False 6 | 7 | c.ServerApp.root_dir = mkdtemp(prefix="galata-test-") 8 | c.ServerApp.token = "" 9 | c.ServerApp.password = "" 10 | c.ServerApp.disable_check_xsrf = True 11 | 12 | c.JupyterNotebookApp.expose_app_in_browser = True 13 | -------------------------------------------------------------------------------- /packages/tree/src/token.ts: -------------------------------------------------------------------------------- 1 | import { Token } from '@lumino/coreutils'; 2 | import { TabPanel } from '@lumino/widgets'; 3 | 4 | /** 5 | * The INotebookTree interface. 6 | */ 7 | export interface INotebookTree extends TabPanel {} 8 | 9 | /** 10 | * The INotebookTree token. 11 | */ 12 | export const INotebookTree = new Token( 13 | '@jupyter-notebook/tree:INotebookTree' 14 | ); 15 | -------------------------------------------------------------------------------- /.github/workflows/enforce-label.yml: -------------------------------------------------------------------------------- 1 | name: Enforce PR label 2 | 3 | on: 4 | pull_request: 5 | types: [labeled, unlabeled, opened, edited, synchronize] 6 | jobs: 7 | enforce-label: 8 | runs-on: ubuntu-latest 9 | permissions: 10 | pull-requests: write 11 | steps: 12 | - name: enforce-triage-label 13 | uses: jupyterlab/maintainer-tools/.github/actions/enforce-label@v1 14 | -------------------------------------------------------------------------------- /.github/workflows/binder.yml: -------------------------------------------------------------------------------- 1 | name: Binder Badge 2 | on: 3 | pull_request_target: 4 | types: [opened] 5 | 6 | jobs: 7 | binder: 8 | runs-on: ubuntu-latest 9 | permissions: 10 | pull-requests: write 11 | steps: 12 | - uses: jupyterlab/maintainer-tools/.github/actions/binder-link@v1 13 | with: 14 | github_token: ${{ secrets.github_token }} 15 | url_path: tree 16 | -------------------------------------------------------------------------------- /RELEASE.md: -------------------------------------------------------------------------------- 1 | # Releasing Jupyter Notebook 2 | 3 | ## Automated releases 4 | 5 | The recommended way to make a release is to use [`jupyter_releaser`](https://github.com/jupyter-server/jupyter_releaser#checklist-for-adoption). 6 | 7 | We follow a similar bump strategy as in JupyterLab: https://github.com/jupyterlab/jupyterlab/blob/master/RELEASE.md#bump-version 8 | 9 | If you would still like to do the release manually instead, read below. 10 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | ==================== 2 | The Jupyter Notebook 3 | ==================== 4 | 5 | 6 | .. image:: ./_static/images/notebook-running-code.png 7 | 8 | * `Installation `_ 9 | * `Starting the Notebook `_ 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | 14 | user-documentation 15 | configuration 16 | contributor 17 | -------------------------------------------------------------------------------- /notebook/__init__.py: -------------------------------------------------------------------------------- 1 | from ._version import __version__ # noqa 2 | 3 | 4 | def _jupyter_server_extension_paths(): 5 | return [{"module": "notebook"}] 6 | 7 | 8 | def _jupyter_server_extension_points(): 9 | from .app import JupyterNotebookApp 10 | 11 | return [{"module": "notebook", "app": JupyterNotebookApp}] 12 | 13 | 14 | def _jupyter_labextension_paths(): 15 | return [{"src": "labextension", "dest": "@jupyter-notebook/lab-extension"}] 16 | -------------------------------------------------------------------------------- /packages/lab-extension/style/base.css: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | | Copyright (c) Jupyter Development Team. 3 | | Distributed under the terms of the Modified BSD License. 4 | |----------------------------------------------------------------------------*/ 5 | 6 | .jp-InterfaceSwitcher { 7 | display: flex; 8 | flex-direction: column; 9 | align-items: center; 10 | justify-content: center; 11 | } 12 | -------------------------------------------------------------------------------- /app/webpack.config.watch.js: -------------------------------------------------------------------------------- 1 | const base = require('./webpack.config'); 2 | const ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin'); 3 | 4 | module.exports = [ 5 | { 6 | ...base[0], 7 | bail: false, 8 | watch: true, 9 | plugins: [ 10 | ...base[0].plugins, 11 | new ExtraWatchWebpackPlugin({ 12 | files: ['../packages/_metapackage/tsconfig.tsbuildinfo'] 13 | }) 14 | ] 15 | }, 16 | ...base.slice(1) 17 | ]; 18 | -------------------------------------------------------------------------------- /.bumpversion.cfg: -------------------------------------------------------------------------------- 1 | [bumpversion] 2 | current_version = 7, 0, 0, "alpha", 5 3 | commit = False 4 | tag = False 5 | parse = (?P\d+)\,\ (?P\d+)\,\ (?P\d+)\,\ \"(?P\S+)\"\,\ (?P\d+) 6 | serialize = 7 | {major}, {minor}, {patch}, "{release}", {build} 8 | 9 | [bumpversion:part:release] 10 | optional_value = final 11 | values = 12 | alpha 13 | beta 14 | candidate 15 | final 16 | 17 | [bumpversion:part:build] 18 | 19 | [bumpversion:file:notebook/_version.py] 20 | -------------------------------------------------------------------------------- /docs/jsdoc_plugin.js: -------------------------------------------------------------------------------- 1 | exports.handlers = { 2 | newDoclet: function(e) { 3 | // e.doclet will refer to the newly created doclet 4 | // you can read and modify properties of that doclet if you wish 5 | if (typeof e.doclet.name === 'string') { 6 | if (e.doclet.name[0] === '_') { 7 | console.log( 8 | 'Private method "' + e.doclet.longname + '" not documented.' 9 | ); 10 | e.doclet.memberof = ''; 11 | } 12 | } 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /packages/application/style/index.js: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | | Copyright (c) Jupyter Development Team. 3 | | Distributed under the terms of the Modified BSD License. 4 | |----------------------------------------------------------------------------*/ 5 | 6 | import '@jupyterlab/application/style/index.js'; 7 | import '@jupyterlab/mainmenu/style/index.js'; 8 | import '@jupyterlab/ui-components/style/index.js'; 9 | 10 | import './base.css'; 11 | -------------------------------------------------------------------------------- /packages/documentsearch-extension/schema/notebookShellWidgetListener.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Jupyter Notebook DocumentSearch Settings", 3 | "description": "Jupyter Notebook DocumentSearch Settings", 4 | "jupyter.lab.shortcuts": [ 5 | { 6 | "command": "documentsearch:start", 7 | "keys": ["Accel F"], 8 | "selector": ".jp-mod-searchable", 9 | "disabled": true 10 | } 11 | ], 12 | "properties": {}, 13 | "additionalProperties": false, 14 | "type": "object" 15 | } 16 | -------------------------------------------------------------------------------- /packages/lab-extension/schema/launch-tree.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Launch Shortcuts", 3 | "description": "Launch Shortcuts.", 4 | "jupyter.lab.menus": { 5 | "main": [ 6 | { 7 | "id": "jp-mainmenu-help", 8 | "items": [ 9 | { 10 | "command": "jupyter-notebook:launch-tree", 11 | "rank": 1 12 | } 13 | ] 14 | } 15 | ] 16 | }, 17 | "properties": {}, 18 | "additionalProperties": false, 19 | "type": "object" 20 | } 21 | -------------------------------------------------------------------------------- /packages/application-extension/schema/zen.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Jupyter Notebook Zen Mode", 3 | "description": "Jupyter Notebook Zen Mode", 4 | "jupyter.lab.menus": { 5 | "main": [ 6 | { 7 | "id": "jp-mainmenu-view", 8 | "items": [ 9 | { 10 | "command": "application:toggle-zen", 11 | "rank": 3 12 | } 13 | ] 14 | } 15 | ] 16 | }, 17 | "properties": {}, 18 | "additionalProperties": false, 19 | "type": "object" 20 | } 21 | -------------------------------------------------------------------------------- /docs/source/extending/index.rst: -------------------------------------------------------------------------------- 1 | ====================== 2 | Extending the Notebook 3 | ====================== 4 | 5 | Certain subsystems of the notebook server are designed to be extended or 6 | overridden by users. These documents explain these systems, and show how to 7 | override the notebook's defaults with your own custom behavior. 8 | 9 | .. toctree:: 10 | :maxdepth: 2 11 | 12 | Extending the Jupyter Server 13 | frontend_extensions 14 | -------------------------------------------------------------------------------- /packages/application/style/index.css: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | | Copyright (c) Jupyter Development Team. 3 | | Distributed under the terms of the Modified BSD License. 4 | |----------------------------------------------------------------------------*/ 5 | 6 | @import url('~@jupyterlab/application/style/index.css'); 7 | @import url('~@jupyterlab/mainmenu/style/index.css'); 8 | @import url('~@jupyterlab/ui-components/style/index.css'); 9 | 10 | @import url('./base.css'); 11 | -------------------------------------------------------------------------------- /packages/application-extension/style/base.css: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | | Copyright (c) Jupyter Development Team. 3 | | 4 | | Distributed under the terms of the Modified BSD License. 5 | |----------------------------------------------------------------------------*/ 6 | 7 | .jp-NotebookSpacer { 8 | flex-grow: 1; 9 | flex-shrink: 1; 10 | } 11 | 12 | .jp-MainAreaWidget { 13 | height: 100%; 14 | } 15 | 16 | .jp-Toolbar > .jp-Toolbar-item { 17 | height: unset; 18 | } 19 | -------------------------------------------------------------------------------- /tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "noEmitOnError": true, 5 | "noUnusedLocals": true, 6 | "module": "commonjs", 7 | "moduleResolution": "node", 8 | "target": "es2015", 9 | "lib": [ 10 | "es2015", 11 | "es2015.collection", 12 | "dom", 13 | "es2015.iterable", 14 | "es2017.object" 15 | ], 16 | "types": ["jest"], 17 | "jsx": "react", 18 | "resolveJsonModule": true, 19 | "esModuleInterop": true, 20 | "skipLibCheck": true 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/ui-components/src/icon/iconimports.ts: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | | Copyright (c) Jupyter Development Team. 3 | | Distributed under the terms of the Modified BSD License. 4 | |----------------------------------------------------------------------------*/ 5 | 6 | import { LabIcon } from '@jupyterlab/ui-components'; 7 | 8 | import jupyterSvgstr from '../../style/icons/jupyter.svg'; 9 | 10 | export const jupyterIcon = new LabIcon({ 11 | name: 'notebook-ui-components:jupyter', 12 | svgstr: jupyterSvgstr 13 | }); 14 | -------------------------------------------------------------------------------- /.github/workflows/lock.yml: -------------------------------------------------------------------------------- 1 | name: 'Lock Closed Threads' 2 | 3 | on: 4 | schedule: 5 | - cron: '0 0 * * *' 6 | 7 | permissions: 8 | issues: 9 | write 10 | pull-requests: 11 | write 12 | 13 | jobs: 14 | lock: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: dessant/lock-threads@v2 18 | with: 19 | github-token: ${{ github.token }} 20 | issue-lock-inactive-days: '180' 21 | issue-lock-labels: 'status:resolved-locked' 22 | pr-lock-inactive-days: '180' 23 | pr-lock-labels: 'status:resolved-locked' 24 | -------------------------------------------------------------------------------- /packages/_metapackage/src/index.ts: -------------------------------------------------------------------------------- 1 | import '@jupyter-notebook/application'; 2 | import '@jupyter-notebook/application-extension'; 3 | import '@jupyter-notebook/console-extension'; 4 | import '@jupyter-notebook/docmanager-extension'; 5 | import '@jupyter-notebook/documentsearch-extension'; 6 | import '@jupyter-notebook/help-extension'; 7 | import '@jupyter-notebook/lab-extension'; 8 | import '@jupyter-notebook/notebook-extension'; 9 | import '@jupyter-notebook/terminal-extension'; 10 | import '@jupyter-notebook/tree'; 11 | import '@jupyter-notebook/tree-extension'; 12 | import '@jupyter-notebook/ui-components'; 13 | -------------------------------------------------------------------------------- /packages/application-extension/schema/pages.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Jupyter Notebook Pages", 3 | "description": "Jupyter Notebook Pages", 4 | "jupyter.lab.menus": { 5 | "main": [ 6 | { 7 | "id": "jp-mainmenu-view", 8 | "items": [ 9 | { 10 | "command": "application:open-lab", 11 | "rank": 2 12 | }, 13 | { 14 | "command": "application:open-tree", 15 | "rank": 2 16 | } 17 | ] 18 | } 19 | ] 20 | }, 21 | "properties": {}, 22 | "additionalProperties": false, 23 | "type": "object" 24 | } 25 | -------------------------------------------------------------------------------- /tsconfigbase.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "composite": true, 5 | "declaration": true, 6 | "esModuleInterop": true, 7 | "incremental": true, 8 | "jsx": "react", 9 | "module": "esnext", 10 | "moduleResolution": "node", 11 | "noEmitOnError": true, 12 | "noImplicitAny": true, 13 | "noUnusedLocals": true, 14 | "preserveWatchOutput": true, 15 | "resolveJsonModule": true, 16 | "strict": true, 17 | "skipLibCheck": true, 18 | "strictNullChecks": true, 19 | "target": "es2017", 20 | "types": [] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/notebook-extension/schema/scroll-output.json: -------------------------------------------------------------------------------- 1 | { 2 | "jupyter.lab.setting-icon": "notebook-ui-components:jupyter", 3 | "jupyter.lab.setting-icon-label": "Jupyter Notebook Notebook", 4 | "title": "Jupyter Notebook Notebook", 5 | "description": "Jupyter Notebook Notebook settings", 6 | "properties": { 7 | "autoScrollOutputs": { 8 | "type": "boolean", 9 | "title": "Auto Scroll Outputs", 10 | "description": "Whether to auto scroll the output area when the outputs become too long", 11 | "default": true 12 | } 13 | }, 14 | "additionalProperties": false, 15 | "type": "object" 16 | } 17 | -------------------------------------------------------------------------------- /packages/tree/src/notebook-tree.ts: -------------------------------------------------------------------------------- 1 | import { TabBarSvg } from '@jupyterlab/ui-components'; 2 | 3 | import { TabPanel } from '@lumino/widgets'; 4 | 5 | import { INotebookTree } from './token'; 6 | 7 | /** 8 | * The widget added in main area of the tree view. 9 | */ 10 | export class NotebookTreeWidget extends TabPanel implements INotebookTree { 11 | /** 12 | * Constructor of the NotebookTreeWidget. 13 | */ 14 | constructor() { 15 | super({ 16 | tabPlacement: 'top', 17 | tabsMovable: true, 18 | renderer: TabBarSvg.defaultRenderer 19 | }); 20 | this.addClass('jp-TreePanel'); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /docs/source/examples/Notebook/examples_index.rst: -------------------------------------------------------------------------------- 1 | ================= 2 | Notebook Examples 3 | ================= 4 | 5 | The pages in this section are all converted notebook files. You can also 6 | `view these notebooks on nbviewer`__. 7 | 8 | __ https://nbviewer.jupyter.org/github/jupyter/notebook/blob/main/ 9 | docs/source/examples/Notebook/ 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | 14 | What is the Jupyter Notebook 15 | Notebook Basics 16 | Running Code 17 | Working With Markdown Cells 18 | Custom Keyboard Shortcuts 19 | Importing Notebooks 20 | Connecting with the Qt Console 21 | Typesetting Equations 22 | -------------------------------------------------------------------------------- /docs/source/template.tpl: -------------------------------------------------------------------------------- 1 | {%- extends 'rst.tpl' -%} 2 | 3 | {% macro notebooklink() -%} 4 | 5 | `View the original notebook on nbviewer `__ 6 | 7 | 8 | {%- endmacro %} 9 | 10 | {%- block header %} 11 | {{ notebooklink() }} 12 | {% endblock header -%} 13 | 14 | {%- block footer %} 15 | {{ notebooklink() }} 16 | {% endblock footer -%} 17 | 18 | {% block markdowncell scoped %} 19 | {{ cell.source | markdown2rst | replace(".ipynb>", ".html>") }} 20 | {% endblock markdowncell %} 21 | -------------------------------------------------------------------------------- /tsconfigbase.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "noImplicitAny": true, 5 | "noEmitOnError": true, 6 | "noUnusedLocals": true, 7 | "module": "commonjs", 8 | "moduleResolution": "node", 9 | "target": "es2015", 10 | "outDir": "lib", 11 | "lib": [ 12 | "es2015", 13 | "es2015.collection", 14 | "dom", 15 | "es2015.iterable", 16 | "es2017.object" 17 | ], 18 | "types": ["jest", "node"], 19 | "jsx": "react", 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true, 22 | "strictNullChecks": true, 23 | "skipLibCheck": true 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/test_app.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.fixture 5 | def notebooks(jp_create_notebook, notebookapp): 6 | nbpaths = ( 7 | "notebook1.ipynb", 8 | "jlab_test_notebooks/notebook2.ipynb", 9 | "jlab_test_notebooks/level2/notebook3.ipynb", 10 | ) 11 | for nb in nbpaths: 12 | jp_create_notebook(nb) 13 | return nbpaths 14 | 15 | 16 | async def test_notebook_handler(notebooks, jp_fetch): 17 | for nbpath in notebooks: 18 | r = await jp_fetch("/", nbpath) 19 | assert r.code == 200 20 | # Check that the lab template is loaded 21 | html = r.body.decode() 22 | assert "Jupyter Notebook" in html 23 | -------------------------------------------------------------------------------- /packages/_metapackage/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"], 8 | "references": [ 9 | { "path": "../application" }, 10 | { "path": "../application-extension" }, 11 | { "path": "../console-extension" }, 12 | { "path": "../docmanager-extension" }, 13 | { "path": "../documentsearch-extension" }, 14 | { "path": "../help-extension" }, 15 | { "path": "../lab-extension" }, 16 | { "path": "../notebook-extension" }, 17 | { "path": "../terminal-extension" }, 18 | { "path": "../tree-extension" }, 19 | { "path": "../ui-components" } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /packages/help-extension/schema/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Jupyter Notebook Help Menu Entries", 3 | "description": "Jupyter Notebook Help Menu Entries", 4 | "jupyter.lab.menus": { 5 | "main": [ 6 | { 7 | "id": "jp-mainmenu-help", 8 | "items": [ 9 | { 10 | "command": "help:about", 11 | "rank": 0 12 | }, 13 | { 14 | "type": "separator", 15 | "rank": 1 16 | }, 17 | { 18 | "command": "help:shortcuts", 19 | "rank": 20 20 | } 21 | ] 22 | } 23 | ] 24 | }, 25 | "properties": {}, 26 | "additionalProperties": false, 27 | "type": "object" 28 | } 29 | -------------------------------------------------------------------------------- /packages/application/jest.config.js: -------------------------------------------------------------------------------- 1 | const func = require('@jupyterlab/testutils/lib/jest-config'); 2 | const upstream = func(__dirname); 3 | 4 | const esModules = ['lib0', 'y-protocols'].join('|'); 5 | 6 | let local = { 7 | preset: 'ts-jest/presets/js-with-babel', 8 | transformIgnorePatterns: [ 9 | `/node_modules/(?!${esModules}).+\\.js/(?!(@jupyterlab/.*)/)` 10 | ], 11 | globals: { 12 | 'ts-jest': { 13 | tsconfig: './tsconfig.test.json' 14 | } 15 | }, 16 | transform: { 17 | '\\.(ts|tsx)?$': 'ts-jest', 18 | '\\.svg$': 'jest-raw-loader' 19 | } 20 | }; 21 | 22 | Object.keys(local).forEach(option => { 23 | upstream[option] = local[option]; 24 | }); 25 | 26 | module.exports = upstream; 27 | -------------------------------------------------------------------------------- /packages/lab-extension/schema/interface-switcher.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Interface Switcher", 3 | "description": "Interface Switcher settings.", 4 | "jupyter.lab.toolbars": { 5 | "Notebook": [{ "name": "interfaceSwitcher", "rank": 990 }] 6 | }, 7 | "jupyter.lab.menus": { 8 | "main": [ 9 | { 10 | "id": "jp-mainmenu-view", 11 | "items": [ 12 | { 13 | "command": "jupyter-notebook:open-notebook", 14 | "rank": 10 15 | }, 16 | { 17 | "command": "jupyter-notebook:open-lab", 18 | "rank": 10 19 | } 20 | ] 21 | } 22 | ] 23 | }, 24 | "properties": {}, 25 | "additionalProperties": false, 26 | "type": "object" 27 | } 28 | -------------------------------------------------------------------------------- /.github/answered.yml: -------------------------------------------------------------------------------- 1 | # This action automatically schedules issues to be closed that have been 2 | # labeled as answered if there is no activity on them for 30 days. This takes 3 | # care of the common usecase of an issue being answered to the best of our 4 | # ability and no other follow-up from the submitter. 5 | name: 'Close answered issues' 6 | on: 7 | schedule: 8 | - cron: '30 1 * * *' 9 | 10 | jobs: 11 | stale: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/stale@v3 15 | with: 16 | skip-stale-issue-message: true 17 | days-before-stale: 30 18 | days-before-close: 7 19 | stale-issue-label: 'status:Closing as Answered' 20 | only-issue-labels: 'status:Answered' 21 | -------------------------------------------------------------------------------- /notebook/_version.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Jupyter Development Team. 2 | # Distributed under the terms of the Modified BSD License. 3 | 4 | from collections import namedtuple 5 | 6 | VersionInfo = namedtuple("VersionInfo", ["major", "minor", "micro", "releaselevel", "serial"]) 7 | 8 | # DO NOT EDIT THIS DIRECTLY! It is managed by bumpversion 9 | version_info = VersionInfo(7, 0, 0, "alpha", 5) 10 | 11 | _specifier_ = {"alpha": "a", "beta": "b", "candidate": "rc", "final": ""} 12 | 13 | __version__ = "{}.{}.{}{}".format( 14 | version_info.major, 15 | version_info.minor, 16 | version_info.micro, 17 | ( 18 | "" 19 | if version_info.releaselevel == "final" 20 | else _specifier_[version_info.releaselevel] + str(version_info.serial) 21 | ), 22 | ) 23 | -------------------------------------------------------------------------------- /ui-tests/test/notebooks/empty.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "id": "6f7028b9-4d2c-4fa2-96ee-bfa77bbee434", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [] 10 | } 11 | ], 12 | "metadata": { 13 | "kernelspec": { 14 | "display_name": "Python 3 (ipykernel)", 15 | "language": "python", 16 | "name": "python3" 17 | }, 18 | "language_info": { 19 | "codemirror_mode": { 20 | "name": "ipython", 21 | "version": 3 22 | }, 23 | "file_extension": ".py", 24 | "mimetype": "text/x-python", 25 | "name": "python", 26 | "nbconvert_exporter": "python", 27 | "pygments_lexer": "ipython3", 28 | "version": "3.9.7" 29 | } 30 | }, 31 | "nbformat": 4, 32 | "nbformat_minor": 5 33 | } 34 | -------------------------------------------------------------------------------- /ui-tests/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/ui-tests", 3 | "private": true, 4 | "version": "0.1.0", 5 | "author": "Project Jupyter", 6 | "license": "BSD-3-Clause", 7 | "description": "Jupyter Notebook UI Tests", 8 | "scripts": { 9 | "start": "jupyter notebook --config test/jupyter_server_config.py", 10 | "start:detached": "yarn run start&", 11 | "test": "playwright test", 12 | "test:debug": "PWDEBUG=1 playwright test", 13 | "test:report": "http-server ./playwright-report -a localhost -o", 14 | "test:update": "playwright test --update-snapshots" 15 | }, 16 | "dependencies": { 17 | "@jupyterlab/galata": "~5.0.0-alpha.9", 18 | "@playwright/test": "~1.17.0" 19 | }, 20 | "resolutions": { 21 | "@playwright/test": "~1.17.0" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /docs/resources/Info.plist.example: -------------------------------------------------------------------------------- 1 | # Add this into the info.plist file of an application 2 | # and the icns icon in Contents/Resources 3 | # then move the application twice : 4 | # https://superuser.com/questions/178316/how-to-set-an-icon-for-a-file-type-on-mac 5 | 6 | CFBundleDocumentTypes 7 | 8 | 9 | CFBundleTypeExtensions 10 | 11 | ipynb 12 | 13 | CFBundleTypeIconFile 14 | ipynb_mac_icon 15 | CFBundleTypeName 16 | IPython notebook file 17 | CFBundleTypeRole 18 | None 19 | 20 | 21 | -------------------------------------------------------------------------------- /packages/application-extension/schema/top.json: -------------------------------------------------------------------------------- 1 | { 2 | "jupyter.lab.setting-icon": "notebook-ui-components:jupyter", 3 | "jupyter.lab.setting-icon-label": "Jupyter Notebook Top Area", 4 | "title": "Jupyter Notebook Top Area", 5 | "description": "Jupyter Notebook Top Area settings", 6 | "jupyter.lab.menus": { 7 | "main": [ 8 | { 9 | "id": "jp-mainmenu-view", 10 | "items": [ 11 | { 12 | "command": "application:toggle-top", 13 | "rank": 2 14 | } 15 | ] 16 | } 17 | ] 18 | }, 19 | "properties": { 20 | "visible": { 21 | "type": "boolean", 22 | "title": "Top Bar Visibility", 23 | "description": "Whether to show the top bar or not", 24 | "default": true 25 | } 26 | }, 27 | "additionalProperties": false, 28 | "type": "object" 29 | } 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Is this a common issue? See our Docs. 4 | url: https://jupyter-notebook.readthedocs.io/en/stable/troubleshooting.html#what-to-do-when-things-go-wrong 5 | about: Before opening an issue, make sure your issue hasn't already been addressed in the documentation. 6 | - name: Do you need support or a question answered? See Jupyter Discourse. 7 | url: https://discourse.jupyter.org/c/notebook/31 8 | about: If you have a question or you're having issues installing Jupyter Notebook, try posting on Discourse. There are lots of friendly Joyvans there to help! 9 | - name: Do you have a feature request? See JupyterLab. 10 | url: https://github.com/jupyterlab/jupyterlab 11 | about: We won't likely accept new features for Jupyter Notebook 6.x. We recommend that you check out JupyterLab for new features and support. 12 | -------------------------------------------------------------------------------- /docs/source/spelling_wordlist.txt: -------------------------------------------------------------------------------- 1 | AMS 2 | API 3 | api 4 | args 5 | async 6 | auth 7 | autodetect 8 | Broullón 9 | changelog 10 | config 11 | coroutines 12 | css 13 | CSS 14 | dockerfile 15 | Dockerfile 16 | drop-down 17 | filenames 18 | filesystem 19 | front-end 20 | front end 21 | frontend 22 | github 23 | GitHub 24 | IFrame 25 | iframe 26 | ip 27 | IP 28 | IPython 29 | javascript 30 | JavaScript 31 | jinja 32 | jinja2 33 | Jinja 34 | js 35 | jupyter 36 | Jupyter 37 | Kamens 38 | keepalive 39 | LaTeX 40 | localhost 41 | login 42 | logout 43 | mathjax 44 | MathJax 45 | matplotlib 46 | menubar 47 | metadata 48 | minify 49 | minified 50 | multiline 51 | natively 52 | nbviewer 53 | pre 54 | prerelease 55 | Quantopian 56 | repo 57 | reStructuredText 58 | subclasses 59 | subdirectory 60 | subprocesses 61 | startup 62 | symlink 63 | uncomment 64 | unencrypted 65 | unicode 66 | Unicode 67 | untracked 68 | untrusted 69 | URL 70 | url 71 | username 72 | webserver 73 | websockets 74 | workflow 75 | -------------------------------------------------------------------------------- /docs/resources/generate_icons.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | INKSCAPE=inkscape 3 | 4 | ${INKSCAPE} -z -C --file=ipynb_icon_16x16.svg --export-png=ipynb_icon_16x16_uncrush.png 5 | ${INKSCAPE} -z -C --file=ipynb_icon_24x24.svg --export-png=ipynb_icon_24x24_uncrush.png 6 | ${INKSCAPE} -z -C --file=ipynb_icon_32x32.svg --export-png=ipynb_icon_32x32_uncrush.png 7 | ${INKSCAPE} -z -C --file=ipynb_icon_512x512.svg --export-png=ipynb_icon_64x64_uncrush.png -w 64 -h 64 8 | ${INKSCAPE} -z -C --file=ipynb_icon_512x512.svg --export-png=ipynb_icon_128x128_uncrush.png -w 128 -h 128 9 | ${INKSCAPE} -z -C --file=ipynb_icon_512x512.svg --export-png=ipynb_icon_256x256_uncrush.png -w 256 -h 256 10 | ${INKSCAPE} -z -C --file=ipynb_icon_512x512.svg --export-png=ipynb_icon_512x512_uncrush.png -w 512 -h 512 11 | 12 | 13 | for file in `ls *_uncrush.png`; do 14 | pngcrush -brute -l 9 -reduce -rem alla -rem text -rem time -rem gAMA -rem cHRM -rem iCCP -rem sRGB $file `basename $file _uncrush.png`.png 15 | rm $file 16 | done 17 | -------------------------------------------------------------------------------- /ui-tests/test/notebooks/autoscroll.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "id": "6f7028b9-4d2c-4fa2-96ee-bfa77bbee434", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": ["print('1\\n' * 200)"] 10 | }, 11 | { 12 | "cell_type": "code", 13 | "execution_count": null, 14 | "id": "6f7028b9-4d2c-4fa2-96ee-bfa77bbee434", 15 | "metadata": {}, 16 | "outputs": [], 17 | "source": ["print('1\\n' * 20)"] 18 | } 19 | ], 20 | "metadata": { 21 | "kernelspec": { 22 | "display_name": "Python 3 (ipykernel)", 23 | "language": "python", 24 | "name": "python3" 25 | }, 26 | "language_info": { 27 | "codemirror_mode": { 28 | "name": "ipython", 29 | "version": 3 30 | }, 31 | "file_extension": ".py", 32 | "mimetype": "text/x-python", 33 | "name": "python", 34 | "nbconvert_exporter": "python", 35 | "pygments_lexer": "ipython3", 36 | "version": "3.9.7" 37 | } 38 | }, 39 | "nbformat": 4, 40 | "nbformat_minor": 5 41 | } 42 | -------------------------------------------------------------------------------- /ui-tests/test/utils.ts: -------------------------------------------------------------------------------- 1 | import { IJupyterLabPageFixture } from '@jupyterlab/galata'; 2 | 3 | import { Page } from '@playwright/test'; 4 | 5 | /** 6 | * Run the selected cell and advance. 7 | */ 8 | export async function runAndAdvance( 9 | page: IJupyterLabPageFixture | Page 10 | ): Promise { 11 | await page.click(".jp-Toolbar-item [data-icon='ui-components:run']"); 12 | } 13 | 14 | /** 15 | * Wait for the kernel to be ready 16 | */ 17 | export async function waitForKernelReady( 18 | page: IJupyterLabPageFixture 19 | ): Promise { 20 | await page.waitForSelector('.jp-NotebookKernelStatus-fade'); 21 | await page.waitForFunction(() => { 22 | const status = window.document.getElementsByClassName( 23 | 'jp-NotebookKernelStatus' 24 | )[0]; 25 | 26 | if (!status) { 27 | return false; 28 | } 29 | 30 | const finished = status?.getAnimations().reduce((prev, curr) => { 31 | return prev && curr.playState === 'finished'; 32 | }, true); 33 | return finished; 34 | }); 35 | } 36 | -------------------------------------------------------------------------------- /docs/source/examples/Notebook/nbpackage/nbs/other.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "### Other notebook\n", 8 | "\n", 9 | "This notebook just defines `bar`" 10 | ] 11 | }, 12 | { 13 | "cell_type": "code", 14 | "execution_count": 2, 15 | "metadata": { 16 | "collapsed": false 17 | }, 18 | "outputs": [], 19 | "source": [ 20 | "def bar(x):\n", 21 | " return \"bar\" * x" 22 | ] 23 | } 24 | ], 25 | "metadata": { 26 | "kernelspec": { 27 | "display_name": "Python 3", 28 | "language": "python", 29 | "name": "python3" 30 | }, 31 | "language_info": { 32 | "codemirror_mode": { 33 | "name": "ipython", 34 | "version": 3 35 | }, 36 | "file_extension": ".py", 37 | "mimetype": "text/x-python", 38 | "name": "python", 39 | "nbconvert_exporter": "python", 40 | "pygments_lexer": "ipython3", 41 | "version": "3.5.1" 42 | } 43 | }, 44 | "nbformat": 4, 45 | "nbformat_minor": 0 46 | } 47 | -------------------------------------------------------------------------------- /packages/tree/style/base.css: -------------------------------------------------------------------------------- 1 | .jp-FileBrowser { 2 | height: 100%; 3 | } 4 | 5 | .lm-TabPanel { 6 | height: 100%; 7 | } 8 | 9 | .jp-TreePanel .lm-TabPanel-tabBar { 10 | overflow: visible; 11 | min-height: 32px; 12 | border-bottom: unset; 13 | height: var(--jp-private-toolbar-height); 14 | } 15 | 16 | .jp-TreePanel .lm-TabBar-content { 17 | height: 100%; 18 | } 19 | 20 | .jp-TreePanel .lm-TabBar-tab { 21 | color: var(--jp-ui-font-color0); 22 | font-size: var(--jp-ui-font-size1); 23 | padding-top: 6px; 24 | height: 100%; 25 | } 26 | 27 | .jp-TreePanel .lm-TabBar-tabLabel { 28 | padding-left: 5px; 29 | padding-right: 5px; 30 | } 31 | 32 | .jp-FileBrowser-toolbar.jp-Toolbar .jp-ToolbarButtonComponent { 33 | width: unset; 34 | } 35 | 36 | .jp-FileBrowser-toolbar > .jp-Toolbar-item { 37 | flex-direction: column; 38 | justify-content: center; 39 | } 40 | 41 | .jp-DropdownMenu .lm-MenuBar-itemIcon svg { 42 | vertical-align: sub; 43 | } 44 | 45 | button[data-command='filebrowser:refresh'] .jp-ToolbarButtonComponent-label { 46 | display: none; 47 | } 48 | -------------------------------------------------------------------------------- /docs/source/extending/frontend_extensions.rst: -------------------------------------------------------------------------------- 1 | .. _frontend_extensions: 2 | 3 | =========================== 4 | Custom front-end extensions 5 | =========================== 6 | 7 | This describes the basic steps to write a TypeScript extension for the Jupyter 8 | notebook front-end. This allows you to customize the behaviour of the various 9 | pages like the dashboard, the notebook, or the text editor. 10 | 11 | Starting with Notebook v7, front-end extensions for the notebook can be developed 12 | as prebuilt JupyterLab extensions. 13 | 14 | This means Notebook v7 is able to reuse many of the existing extensions from the JupyterLab ecosystem as is. 15 | 16 | If you would like to develop a prebuilt extension for Notebook v7, check out: 17 | 18 | - `JupyterLab Extension Tutorial `_: A tutorial to learn how to make a simple JupyterLab extension. 19 | - The `JupyterLab Extension Examples Repository `_: A short tutorial series to learn how to develop extensions for JupyterLab by example. 20 | -------------------------------------------------------------------------------- /ui-tests/test/general.spec.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | import path from 'path'; 5 | 6 | import { expect } from '@playwright/test'; 7 | 8 | import { test } from './fixtures'; 9 | import { waitForKernelReady } from './utils'; 10 | 11 | test.describe('General', () => { 12 | test('The notebook should render', async ({ page, tmpPath }) => { 13 | const notebook = 'simple.ipynb'; 14 | await page.contents.uploadFile( 15 | path.resolve(__dirname, `./notebooks/${notebook}`), 16 | `${tmpPath}/${notebook}` 17 | ); 18 | await page.goto(`notebooks/${tmpPath}/${notebook}`); 19 | 20 | // wait for the kernel status animations to be finished 21 | await waitForKernelReady(page); 22 | await page.waitForSelector( 23 | ".jp-Notebook-ExecutionIndicator[data-status='idle']" 24 | ); 25 | 26 | // force switching back to command mode to avoid capturing the cursor in the screenshot 27 | await page.evaluate(async () => { 28 | await window.jupyterapp.commands.execute('notebook:enter-command-mode'); 29 | }); 30 | 31 | expect(await page.screenshot()).toMatchSnapshot('notebook.png'); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /ui-tests/test/tree.spec.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | import { test } from './fixtures'; 5 | 6 | import { expect } from '@playwright/test'; 7 | 8 | const SUBFOLDER = 'subfolder'; 9 | 10 | test('Tree', async ({ page }) => { 11 | await page.goto('tree'); 12 | const button = await page.$('text="New Notebook"'); 13 | expect(button).toBeDefined(); 14 | }); 15 | 16 | test('should go to subfolder', async ({ page, tmpPath }) => { 17 | const dir = `${tmpPath}/${SUBFOLDER}`; 18 | await page.contents.createDirectory(dir); 19 | await page.goto(`tree/${dir}`); 20 | 21 | expect( 22 | await page.waitForSelector(`.jp-FileBrowser-crumbs >> text=/${SUBFOLDER}/`) 23 | ).toBeTruthy(); 24 | }); 25 | 26 | test('should update url when navigating in filebrowser', async ({ 27 | page, 28 | tmpPath 29 | }) => { 30 | await page.contents.createDirectory(`${tmpPath}/${SUBFOLDER}`); 31 | 32 | await page.dblclick(`.jp-FileBrowser-listing >> text=${SUBFOLDER}`); 33 | 34 | await page.waitForSelector(`.jp-FileBrowser-crumbs >> text=/${SUBFOLDER}/`); 35 | 36 | const url = new URL(page.url()); 37 | expect(url.pathname).toEqual(`/tree/${tmpPath}/${SUBFOLDER}`); 38 | }); 39 | -------------------------------------------------------------------------------- /packages/help-extension/style/base.css: -------------------------------------------------------------------------------- 1 | .jp-AboutNotebook .jp-Dialog-header { 2 | justify-content: center; 3 | } 4 | 5 | .jp-AboutNotebook-header { 6 | display: flex; 7 | flex-direction: row; 8 | align-items: center; 9 | padding: var(--jp-flat-button-padding); 10 | } 11 | 12 | .jp-AboutNotebook-header-text { 13 | margin-left: 16px; 14 | } 15 | 16 | .jp-AboutNotebook-body { 17 | display: flex; 18 | font-size: var(--jp-ui-font-size2); 19 | padding: var(--jp-flat-button-padding); 20 | color: var(--jp-ui-font-color1); 21 | text-align: left; 22 | flex-direction: column; 23 | min-width: 360px; 24 | overflow: hidden; 25 | } 26 | 27 | .jp-AboutNotebook-about-body pre { 28 | white-space: pre-wrap; 29 | } 30 | 31 | .jp-AboutNotebook-about-externalLinks { 32 | display: flex; 33 | flex-direction: column; 34 | justify-content: flex-start; 35 | align-items: flex-start; 36 | padding-top: 12px; 37 | color: var(--jp-warn-color0); 38 | } 39 | 40 | .jp-AboutNotebook-shortcuts { 41 | padding: 10px; 42 | } 43 | 44 | .jp-AboutNotebook-shortcuts pre { 45 | padding: 5px; 46 | margin: 0 0 10px; 47 | background: var(--jp-layout-color2); 48 | border: 1px solid var(--jp-border-color0); 49 | border-radius: 2px; 50 | word-break: break-all; 51 | } 52 | -------------------------------------------------------------------------------- /notebook/templates/tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{page_config['appName'] | e}} - Tree 7 | 8 | 9 | 10 | {# Copy so we do not modify the page_config with updates. #} 11 | {% set page_config_full = page_config.copy() %} 12 | 13 | {# Set a dummy variable - we just want the side effect of the update. #} 14 | {% set _ = page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %} 15 | 16 | {# Sentinel value to say that we are on the tree page #} 17 | {% set _ = page_config_full.update(notebookPage='tree') %} 18 | 19 | 22 | 23 | 24 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /ui-tests/test/settings.spec.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | import { test } from './fixtures'; 5 | 6 | import { expect } from '@playwright/test'; 7 | 8 | test.use({ autoGoto: false }); 9 | 10 | test.describe('Settings', () => { 11 | test('Should be persisted after reloading the page', async ({ 12 | page, 13 | tmpPath 14 | }) => { 15 | const showHeaderPath = 'View>Show Header'; 16 | 17 | await page.goto(`tree/${tmpPath}`); 18 | 19 | await page.waitForSelector('#top-panel', { state: 'visible' }); 20 | await page.menu.clickMenuItem(showHeaderPath); 21 | await page.waitForSelector('#top-panel', { state: 'hidden' }); 22 | await page.reload({ waitUntil: 'networkidle' }); 23 | await page.menu.getMenuItem(showHeaderPath); 24 | expect(await page.screenshot()).toMatchSnapshot('top-hidden.png'); 25 | 26 | await page.waitForSelector('#top-panel', { state: 'hidden' }); 27 | await page.menu.clickMenuItem(showHeaderPath); 28 | await page.waitForSelector('#top-panel', { state: 'visible' }); 29 | await page.reload({ waitUntil: 'networkidle' }); 30 | await page.menu.getMenuItem(showHeaderPath); 31 | expect(await page.screenshot()).toMatchSnapshot('top-visible.png'); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /.github/actions/build-dist/action.yml: -------------------------------------------------------------------------------- 1 | name: "Build Jupyter Notebook" 2 | description: "Build Jupyter Notebook from source" 3 | runs: 4 | using: "composite" 5 | steps: 6 | - name: Base Setup 7 | uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 8 | 9 | - name: Install dependencies 10 | shell: bash 11 | run: | 12 | python -m pip install --upgrade jupyter_packaging~=0.10 "jupyterlab>=4.0.0a25,<5" ypy-websocket==0.2 build 13 | 14 | - name: Build pypi distributions 15 | shell: bash 16 | run: | 17 | python -m build 18 | 19 | - name: Build npm distributions 20 | shell: bash 21 | run: | 22 | mkdir pkgs 23 | jlpm lerna exec -- npm pack 24 | cp packages/*/*.tgz pkgs 25 | 26 | - name: Build checksum file 27 | shell: bash 28 | run: | 29 | cd dist 30 | sha256sum * | tee SHA256SUMS 31 | cd ../pkgs 32 | sha256sum * | tee SHA256SUMS 33 | 34 | - name: Upload distributions 35 | uses: actions/upload-artifact@v2 36 | with: 37 | name: notebook-dist-${{ github.run_number }} 38 | path: ./dist 39 | 40 | - name: Upload distributions 41 | uses: actions/upload-artifact@v2 42 | with: 43 | name: notebook-pkgs-${{ github.run_number }} 44 | path: ./pkgs 45 | -------------------------------------------------------------------------------- /.github/workflows/docs.yml: -------------------------------------------------------------------------------- 1 | name: Docs Tests 2 | on: 3 | push: 4 | branches: ['main'] 5 | pull_request: 6 | 7 | concurrency: 8 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} 9 | cancel-in-progress: true 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | timeout-minutes: 10 15 | steps: 16 | - name: Checkout 17 | uses: actions/checkout@v2 18 | - name: Base Setup 19 | uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 20 | with: 21 | python_version: '3.7' 22 | - name: Install the Python dependencies 23 | run: | 24 | pip install -e .[dev,test] codecov 25 | pip install -r docs/doc-requirements.txt 26 | wget https://github.com/jgm/pandoc/releases/download/1.19.1/pandoc-1.19.1-1-amd64.deb && sudo dpkg -i pandoc-1.19.1-1-amd64.deb 27 | - name: List installed packages 28 | run: | 29 | pip freeze 30 | pip check 31 | - name: Run tests on documentation 32 | run: | 33 | EXIT_STATUS=0 34 | make -C docs/ html SPHINXOPTS="-W" || EXIT_STATUS=$? 35 | # Ignore warnings to work around 36 | # # https://github.com/computationalmodelling/nbval/issues/180 37 | pytest --nbval --current-env -W default docs || EXIT_STATUS=$? 38 | exit $EXIT_STATUS 39 | -------------------------------------------------------------------------------- /docs/source/examples/Notebook/Custom Keyboard Shortcuts.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Keyboard Shortcut Customization" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "You can customize the `command` mode shortcuts from within the Notebook Application itself. \n", 15 | "\n", 16 | "Head to the **Settings** menu and select the **Settings Editor** item.\n", 17 | "A dialog will guide you through the process of adding custom keyboard shortcuts.\n", 18 | "\n", 19 | "Keyboard shortcut set from within the Notebook Application will be persisted to your configuration file. \n", 20 | "A single action may have several shortcuts attached to it." 21 | ] 22 | } 23 | ], 24 | "metadata": { 25 | "kernelspec": { 26 | "display_name": "Python 3", 27 | "language": "python", 28 | "name": "python3" 29 | }, 30 | "language_info": { 31 | "codemirror_mode": { 32 | "name": "ipython", 33 | "version": 3 34 | }, 35 | "file_extension": ".py", 36 | "mimetype": "text/x-python", 37 | "name": "python", 38 | "nbconvert_exporter": "python", 39 | "pygments_lexer": "ipython3", 40 | "version": "3.5.2" 41 | }, 42 | "nbsphinx": { 43 | "execute": "never" 44 | } 45 | }, 46 | "nbformat": 4, 47 | "nbformat_minor": 1 48 | } 49 | -------------------------------------------------------------------------------- /notebook/templates/edit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{page_config['appName'] | e}} - Edit 7 | {% block favicon %} 8 | 9 | {% endblock %} 10 | 11 | 12 | 13 | {# Copy so we do not modify the page_config with updates. #} 14 | {% set page_config_full = page_config.copy() %} 15 | 16 | {# Set a dummy variable - we just want the side effect of the update. #} 17 | {% set _ = page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %} 18 | 19 | {# Sentinel value to say that we are on the tree page #} 20 | {% set _ = page_config_full.update(notebookPage='edit') %} 21 | 22 | 25 | 26 | 27 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /notebook/templates/error.html: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | {% block title %}{{page_title | e}}{% endblock %} 12 | 13 | {% block favicon %}{% endblock %} 14 | 15 | 16 | 17 | 18 | 19 | {% block stylesheet %} 20 | 26 | {% endblock %} 27 | {% block site %} 28 | 29 |
30 | {% block h1_error %} 31 |

{{status_code | e}} : {{status_message | e}}

32 | {% endblock h1_error %} 33 | {% block error_detail %} 34 | {% if message %} 35 |

The error was:

36 |
37 |
{{message | e}}
38 |
39 | {% endif %} 40 | {% endblock %} 41 | 42 | 43 | {% endblock %} 44 | 45 | {% block script %} 46 | 55 | {% endblock script %} 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /notebook/templates/terminals.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{page_config['appName'] | e}} - Terminal 7 | {% block favicon %} 8 | 9 | {% endblock %} 10 | 11 | 12 | 13 | {# Copy so we do not modify the page_config with updates. #} 14 | {% set page_config_full = page_config.copy() %} 15 | 16 | {# Set a dummy variable - we just want the side effect of the update. #} 17 | {% set _ = page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %} 18 | 19 | {# Sentinel value to say that we are on the tree page #} 20 | {% set _ = page_config_full.update(notebookPage='terminals') %} 21 | 22 | 25 | 26 | 27 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | import path from 'path'; 5 | 6 | import { test } from './fixtures'; 7 | 8 | import { expect } from '@playwright/test'; 9 | 10 | const NOTEBOOK = 'empty.ipynb'; 11 | 12 | const MENU_PATHS = [ 13 | 'File', 14 | 'File>New', 15 | 'File>Save and Export Notebook As…', 16 | 'Edit', 17 | 'View', 18 | 'Run', 19 | 'Kernel', 20 | 'Settings', 21 | 'Settings>Theme', 22 | 'Help' 23 | ]; 24 | 25 | test.use({ autoGoto: false }); 26 | 27 | test.describe('Notebook Menus', () => { 28 | test.beforeEach(async ({ page, tmpPath }) => { 29 | await page.contents.uploadFile( 30 | path.resolve(__dirname, `./notebooks/${NOTEBOOK}`), 31 | `${tmpPath}/${NOTEBOOK}` 32 | ); 33 | }); 34 | 35 | test.afterEach(async ({ page }) => { 36 | await page.kernel.shutdownAll(); 37 | }); 38 | 39 | MENU_PATHS.forEach(menuPath => { 40 | test(`Open menu item ${menuPath}`, async ({ page, tmpPath }) => { 41 | await page.goto(`notebooks/${tmpPath}/${NOTEBOOK}`); 42 | await page.menu.open(menuPath); 43 | expect(await page.menu.isOpen(menuPath)).toBeTruthy(); 44 | 45 | const imageName = `opened-menu-${menuPath.replace(/>/g, '-')}.png`; 46 | const menu = await page.menu.getOpenMenu(); 47 | expect(await menu.screenshot()).toMatchSnapshot(imageName.toLowerCase()); 48 | }); 49 | }); 50 | }); 51 | -------------------------------------------------------------------------------- /notebook/templates/consoles.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{page_config['appName'] | e}} - Console 7 | {% block favicon %} 8 | 9 | {% endblock %} 10 | 11 | 12 | 13 | {# Copy so we do not modify the page_config with updates. #} 14 | {% set page_config_full = page_config.copy() %} 15 | 16 | {# Set a dummy variable - we just want the side effect of the update. #} 17 | {% set _ = page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %} 18 | 19 | {# Sentinel value to say that we are on the tree page #} 20 | {% set _ = page_config_full.update(notebookPage='consoles') %} 21 | 22 | 25 | 26 | 27 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /app/publicpath.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | // We dynamically set the webpack public path based on the page config 5 | // settings from the JupyterLab app. We copy some of the pageconfig parsing 6 | // logic in @jupyterlab/coreutils below, since this must run before any other 7 | // files are loaded (including @jupyterlab/coreutils). 8 | 9 | /** 10 | * Get global configuration data for the Jupyter application. 11 | * 12 | * @param name - The name of the configuration option. 13 | * 14 | * @returns The config value or an empty string if not found. 15 | * 16 | * #### Notes 17 | * All values are treated as strings. 18 | * For browser based applications, it is assumed that the page HTML 19 | * includes a script tag with the id `jupyter-config-data` containing the 20 | * configuration as valid JSON. In order to support the classic Notebook, 21 | * we fall back on checking for `body` data of the given `name`. 22 | */ 23 | function getOption(name) { 24 | let configData = Object.create(null); 25 | // Use script tag if available. 26 | if (typeof document !== 'undefined' && document) { 27 | const el = document.getElementById('jupyter-config-data'); 28 | 29 | if (el) { 30 | configData = JSON.parse(el.textContent || '{}'); 31 | } 32 | } 33 | return configData[name] || ''; 34 | } 35 | 36 | // eslint-disable-next-line no-undef 37 | __webpack_public_path__ = getOption('fullStaticUrl') + '/'; 38 | -------------------------------------------------------------------------------- /docs/source/examples/Notebook/nbpackage/mynotebook.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# My Notebook" 8 | ] 9 | }, 10 | { 11 | "cell_type": "code", 12 | "execution_count": 1, 13 | "metadata": { 14 | "collapsed": false 15 | }, 16 | "outputs": [], 17 | "source": [ 18 | "def foo():\n", 19 | " return \"foo\"" 20 | ] 21 | }, 22 | { 23 | "cell_type": "code", 24 | "execution_count": 2, 25 | "metadata": { 26 | "collapsed": false 27 | }, 28 | "outputs": [], 29 | "source": [ 30 | "def has_ip_syntax():\n", 31 | " listing = !ls\n", 32 | " return listing" 33 | ] 34 | }, 35 | { 36 | "cell_type": "code", 37 | "execution_count": 4, 38 | "metadata": { 39 | "collapsed": false 40 | }, 41 | "outputs": [], 42 | "source": [ 43 | "def whatsmyname():\n", 44 | " return __name__" 45 | ] 46 | } 47 | ], 48 | "metadata": { 49 | "kernelspec": { 50 | "display_name": "Python 3", 51 | "language": "python", 52 | "name": "python3" 53 | }, 54 | "language_info": { 55 | "codemirror_mode": { 56 | "name": "ipython", 57 | "version": 3 58 | }, 59 | "file_extension": ".py", 60 | "mimetype": "text/x-python", 61 | "name": "python", 62 | "nbconvert_exporter": "python", 63 | "pygments_lexer": "ipython3", 64 | "version": "3.5.1+" 65 | } 66 | }, 67 | "nbformat": 4, 68 | "nbformat_minor": 0 69 | } 70 | -------------------------------------------------------------------------------- /notebook/templates/notebooks.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{page_config['appName'] | e}} - Notebook 7 | {% block favicon %} 8 | 9 | {% endblock %} 10 | 11 | 12 | 13 | {# Copy so we do not modify the page_config with updates. #} 14 | {% set page_config_full = page_config.copy() %} 15 | 16 | {# Set a dummy variable - we just want the side effect of the update. #} 17 | {% set _ = page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %} 18 | 19 | {# Sentinel value to say that we are on the tree page #} 20 | {% set _ = page_config_full.update(notebookPage='notebooks') %} 21 | 22 | 25 | 26 | 27 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /.github/workflows/check-release.yml: -------------------------------------------------------------------------------- 1 | name: Check Release 2 | on: 3 | push: 4 | branches: ["main"] 5 | pull_request: 6 | 7 | permissions: 8 | contents: 9 | write 10 | 11 | concurrency: 12 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} 13 | cancel-in-progress: true 14 | 15 | jobs: 16 | check_release: 17 | runs-on: ubuntu-latest 18 | timeout-minutes: 30 19 | strategy: 20 | matrix: 21 | group: [check_release, link_check] 22 | fail-fast: false 23 | steps: 24 | - name: Checkout 25 | uses: actions/checkout@v2 26 | - name: Base Setup 27 | uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 28 | - name: Install Dependencies 29 | run: | 30 | pip install -e . 31 | - name: Check Release 32 | if: ${{ matrix.group == 'check_release' }} 33 | uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1 34 | with: 35 | token: ${{ secrets.GITHUB_TOKEN }} 36 | version_spec: next 37 | - name: Check Links 38 | if: ${{ matrix.group == 'link_check' }} 39 | uses: jupyter-server/jupyter_releaser/.github/actions/check-links@v1 40 | 41 | - name: Upload Distributions 42 | uses: actions/upload-artifact@v2 43 | if: ${{ matrix.group == 'check_release' }} 44 | with: 45 | name: notebook-jupyter-releaser-dist-${{ github.run_number }} 46 | path: .jupyter_releaser_checkout/dist 47 | -------------------------------------------------------------------------------- /packages/_metapackage/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/metapackage", 3 | "version": "7.0.0-alpha.5", 4 | "private": true, 5 | "description": "Jupyter Notebook - Metapackage", 6 | "homepage": "https://github.com/jupyter/notebook", 7 | "bugs": { 8 | "url": "https://github.com/jupyter/notebook/issues" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/jupyter/notebook.git" 13 | }, 14 | "license": "BSD-3-Clause", 15 | "author": "Project Jupyter", 16 | "main": "lib/index.js", 17 | "types": "lib/index.d.ts", 18 | "scripts": { 19 | "build": "tsc -b", 20 | "watch": "tsc -b -w --preserveWatchOutput" 21 | }, 22 | "dependencies": { 23 | "@jupyter-notebook/application": "file:../application", 24 | "@jupyter-notebook/application-extension": "file:../application-extension", 25 | "@jupyter-notebook/console-extension": "file:../console-extension", 26 | "@jupyter-notebook/docmanager-extension": "file:../docmanager-extension", 27 | "@jupyter-notebook/documentsearch-extension": "file:../documentsearch-extension", 28 | "@jupyter-notebook/help-extension": "file:../help-extension", 29 | "@jupyter-notebook/lab-extension": "file:../lab-extension", 30 | "@jupyter-notebook/notebook-extension": "file:../notebook-extension", 31 | "@jupyter-notebook/terminal-extension": "file:../terminal-extension", 32 | "@jupyter-notebook/tree": "file:../tree", 33 | "@jupyter-notebook/tree-extension": "file:../tree-extension", 34 | "@jupyter-notebook/ui-components": "file:../ui-components" 35 | }, 36 | "devDependencies": { 37 | "typescript": "~4.6.3" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /packages/console-extension/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/console-extension", 3 | "version": "7.0.0-alpha.5", 4 | "description": "Jupyter Notebook - Console Extension", 5 | "homepage": "https://github.com/jupyter/notebook", 6 | "bugs": { 7 | "url": "https://github.com/jupyter/notebook/issues" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/jupyter/notebook.git" 12 | }, 13 | "license": "BSD-3-Clause", 14 | "author": "Project Jupyter", 15 | "sideEffects": [ 16 | "style/**/*.css", 17 | "style/index.js" 18 | ], 19 | "main": "lib/index.js", 20 | "types": "lib/index.d.ts", 21 | "style": "style/index.css", 22 | "directories": { 23 | "lib": "lib/" 24 | }, 25 | "files": [ 26 | "lib/*.d.ts", 27 | "lib/*.js.map", 28 | "lib/*.js", 29 | "schema/*.json", 30 | "style/**/*.css", 31 | "style/index.js" 32 | ], 33 | "scripts": { 34 | "build": "tsc -b", 35 | "build:prod": "tsc -b", 36 | "clean": "rimraf lib && rimraf tsconfig.tsbuildinfo", 37 | "docs": "typedoc src", 38 | "prepublishOnly": "npm run build", 39 | "watch": "tsc -b --watch" 40 | }, 41 | "dependencies": { 42 | "@jupyterlab/application": "^4.0.0-alpha.10", 43 | "@jupyterlab/console": "^4.0.0-alpha.10", 44 | "@jupyterlab/coreutils": "^6.0.0-alpha.10", 45 | "@lumino/algorithm": "^1.9.1" 46 | }, 47 | "devDependencies": { 48 | "rimraf": "~3.0.0", 49 | "typescript": "~4.6.3" 50 | }, 51 | "publishConfig": { 52 | "access": "public" 53 | }, 54 | "jupyterlab": { 55 | "extension": true 56 | }, 57 | "styleModule": "style/index.js" 58 | } 59 | -------------------------------------------------------------------------------- /packages/terminal-extension/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/terminal-extension", 3 | "version": "7.0.0-alpha.5", 4 | "description": "Jupyter Notebook - Terminal Extension", 5 | "homepage": "https://github.com/jupyter/notebook", 6 | "bugs": { 7 | "url": "https://github.com/jupyter/notebook/issues" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/jupyter/notebook.git" 12 | }, 13 | "license": "BSD-3-Clause", 14 | "author": "Project Jupyter", 15 | "sideEffects": [ 16 | "style/**/*.css", 17 | "style/index.js" 18 | ], 19 | "main": "lib/index.js", 20 | "types": "lib/index.d.ts", 21 | "style": "style/index.css", 22 | "directories": { 23 | "lib": "lib/" 24 | }, 25 | "files": [ 26 | "lib/*.d.ts", 27 | "lib/*.js.map", 28 | "lib/*.js", 29 | "schema/*.json", 30 | "style/**/*.css", 31 | "style/index.js" 32 | ], 33 | "scripts": { 34 | "build": "tsc -b", 35 | "build:prod": "tsc -b", 36 | "clean": "rimraf lib && rimraf tsconfig.tsbuildinfo", 37 | "docs": "typedoc src", 38 | "prepublishOnly": "npm run build", 39 | "watch": "tsc -b --watch" 40 | }, 41 | "dependencies": { 42 | "@jupyterlab/application": "^4.0.0-alpha.10", 43 | "@jupyterlab/coreutils": "^6.0.0-alpha.10", 44 | "@jupyterlab/terminal": "^4.0.0-alpha.10", 45 | "@lumino/algorithm": "^1.9.1" 46 | }, 47 | "devDependencies": { 48 | "rimraf": "~3.0.0", 49 | "typescript": "~4.6.3" 50 | }, 51 | "publishConfig": { 52 | "access": "public" 53 | }, 54 | "jupyterlab": { 55 | "extension": true 56 | }, 57 | "styleModule": "style/index.js" 58 | } 59 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | browser: true, 4 | es6: true, 5 | commonjs: true, 6 | node: true, 7 | 'jest/globals': true 8 | }, 9 | root: true, 10 | extends: [ 11 | 'eslint:recommended', 12 | 'plugin:@typescript-eslint/eslint-recommended', 13 | 'plugin:@typescript-eslint/recommended', 14 | 'plugin:prettier/recommended', 15 | 'plugin:react/recommended', 16 | 'plugin:jest/recommended' 17 | ], 18 | parser: '@typescript-eslint/parser', 19 | parserOptions: { 20 | project: 'tsconfig.eslint.json', 21 | sourceType: 'module' 22 | }, 23 | plugins: ['@typescript-eslint', 'jest'], 24 | rules: { 25 | '@typescript-eslint/naming-convention': [ 26 | 'error', 27 | { 28 | selector: 'interface', 29 | format: ['PascalCase'], 30 | custom: { 31 | regex: '^I[A-Z]', 32 | match: true 33 | } 34 | } 35 | ], 36 | '@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }], 37 | '@typescript-eslint/no-explicit-any': 'off', 38 | '@typescript-eslint/no-namespace': 'off', 39 | '@typescript-eslint/no-var-requires': 'off', 40 | '@typescript-eslint/no-use-before-define': 'off', 41 | '@typescript-eslint/no-empty-interface': 'off', 42 | '@typescript-eslint/quotes': [ 43 | 'error', 44 | 'single', 45 | { avoidEscape: true, allowTemplateLiterals: false } 46 | ], 47 | 'jest/no-done-callback': 'off', 48 | curly: ['error', 'all'], 49 | eqeqeq: 'error', 50 | 'prefer-arrow-callback': 'error' 51 | }, 52 | settings: { 53 | react: { 54 | version: 'detect' 55 | } 56 | } 57 | }; 58 | -------------------------------------------------------------------------------- /ui-tests/test/mobile.spec.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | import path from 'path'; 5 | 6 | import { expect } from '@playwright/test'; 7 | 8 | import { test } from './fixtures'; 9 | import { waitForKernelReady } from './utils'; 10 | 11 | test.use({ autoGoto: false, viewport: { width: 512, height: 768 } }); 12 | 13 | test.describe('Mobile', () => { 14 | test('The layout should be more compact on the file browser page', async ({ 15 | page, 16 | tmpPath 17 | }) => { 18 | await page.goto(`tree/${tmpPath}`); 19 | await page.waitForSelector('#top-panel-wrapper', { state: 'hidden' }); 20 | expect(await page.screenshot()).toMatchSnapshot('tree.png'); 21 | }); 22 | 23 | test('The layout should be more compact on the notebook page', async ({ 24 | page, 25 | tmpPath 26 | }) => { 27 | const notebook = 'empty.ipynb'; 28 | await page.contents.uploadFile( 29 | path.resolve(__dirname, `./notebooks/${notebook}`), 30 | `${tmpPath}/${notebook}` 31 | ); 32 | await page.goto(`notebooks/${tmpPath}/${notebook}`); 33 | // TODO: investigate why this does not run the cells in Jupyter Notebook 34 | // await page.notebook.run(); 35 | 36 | // wait for the kernel status animations to be finished 37 | await waitForKernelReady(page); 38 | 39 | // force switching back to command mode to avoid capturing the cursor in the screenshot 40 | await page.evaluate(async () => { 41 | await window.jupyterapp.commands.execute('notebook:enter-command-mode'); 42 | }); 43 | 44 | expect(await page.screenshot()).toMatchSnapshot('notebook.png'); 45 | }); 46 | }); 47 | -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | github: 2 | prebuilds: 3 | master: true 4 | pullRequests: true 5 | pullRequestsFromForks: true 6 | addCheck: false 7 | addComment: false 8 | addBadge: false 9 | addLabel: false 10 | tasks: 11 | - name: setup 12 | init: | 13 | pushd /workspace 14 | wget -qO- https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba 15 | popd 16 | # bootstrap activation commands for other tasks to reuse 17 | cat < /workspace/bin/activate-env.sh 18 | export MAMBA_ROOT_PREFIX=/workspace/.micromamba 19 | export MAMBA_EXE=/workspace/bin/micromamba 20 | $(/workspace/bin/micromamba shell hook --shell=bash) 21 | export JUPYTER_PREFER_ENV_PATH=1 22 | micromamba activate 23 | EOT 24 | source /workspace/bin/activate-env.sh 25 | micromamba install -n base -y -c conda-forge python=3.10 nodejs=14 yarn 26 | python -m pip install -e ".[dev,test]" && jlpm && jlpm run build && jlpm develop 27 | gp sync-done setup 28 | command: | 29 | gp sync-done setup 30 | source /workspace/bin/activate-env.sh 31 | jupyter notebook --no-browser --JupyterNotebookApp.token='' --JupyterNotebookApp.allow_origin=* --JupyterNotebookApp.tornado_settings='{"headers": {"Content-Security-Policy": "frame-ancestors *"}}' 32 | 33 | - name: auto-activate 34 | command: | 35 | gp sync-await setup 36 | source /workspace/bin/activate-env.sh 37 | jlpm watch 38 | 39 | - name: shell 40 | command: | 41 | gp sync-await setup 42 | echo "source /workspace/bin/activate-env.sh" >> ~/.bashrc 43 | source /workspace/bin/activate-env.sh 44 | 45 | ports: 46 | - port: 8888 47 | -------------------------------------------------------------------------------- /packages/documentsearch-extension/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/documentsearch-extension", 3 | "version": "7.0.0-alpha.5", 4 | "description": "Jupyter Notebook - Document Search Extension", 5 | "homepage": "https://github.com/jupyter/notebook", 6 | "bugs": { 7 | "url": "https://github.com/jupyter/notebook/issues" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/jupyter/notebook.git" 12 | }, 13 | "license": "BSD-3-Clause", 14 | "author": "Project Jupyter", 15 | "sideEffects": [ 16 | "style/**/*.css", 17 | "style/index.js" 18 | ], 19 | "main": "lib/index.js", 20 | "types": "lib/index.d.ts", 21 | "style": "style/index.css", 22 | "directories": { 23 | "lib": "lib/" 24 | }, 25 | "files": [ 26 | "lib/*.d.ts", 27 | "lib/*.js.map", 28 | "lib/*.js", 29 | "schema/*.json", 30 | "style/**/*.css", 31 | "style/index.js" 32 | ], 33 | "scripts": { 34 | "build": "tsc -b", 35 | "build:prod": "tsc -b", 36 | "clean": "rimraf lib && rimraf tsconfig.tsbuildinfo", 37 | "docs": "typedoc src", 38 | "prepublishOnly": "npm run build", 39 | "watch": "tsc -b --watch" 40 | }, 41 | "dependencies": { 42 | "@jupyter-notebook/application": "^7.0.0-alpha.5", 43 | "@jupyterlab/application": "^4.0.0-alpha.10", 44 | "@jupyterlab/documentsearch": "^4.0.0-alpha.10", 45 | "@lumino/widgets": "^1.32.0" 46 | }, 47 | "devDependencies": { 48 | "rimraf": "~3.0.0", 49 | "typescript": "~4.6.3" 50 | }, 51 | "publishConfig": { 52 | "access": "public" 53 | }, 54 | "jupyterlab": { 55 | "extension": true, 56 | "schemaDir": "schema" 57 | }, 58 | "styleModule": "style/index.js" 59 | } 60 | -------------------------------------------------------------------------------- /packages/help-extension/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/help-extension", 3 | "version": "7.0.0-alpha.5", 4 | "description": "Jupyter Notebook - Help Extension", 5 | "homepage": "https://github.com/jupyter/notebook", 6 | "bugs": { 7 | "url": "https://github.com/jupyter/notebook/issues" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/jupyter/notebook.git" 12 | }, 13 | "license": "BSD-3-Clause", 14 | "author": "Project Jupyter", 15 | "sideEffects": [ 16 | "style/**/*.css", 17 | "style/index.js" 18 | ], 19 | "main": "lib/index.js", 20 | "types": "lib/index.d.ts", 21 | "style": "style/index.css", 22 | "directories": { 23 | "lib": "lib/" 24 | }, 25 | "files": [ 26 | "lib/*.d.ts", 27 | "lib/*.js.map", 28 | "lib/*.js", 29 | "schema/*.json", 30 | "style/**/*.css", 31 | "style/index.js" 32 | ], 33 | "scripts": { 34 | "build": "tsc -b", 35 | "build:prod": "tsc -b", 36 | "clean": "rimraf lib && rimraf tsconfig.tsbuildinfo", 37 | "docs": "typedoc src", 38 | "prepublishOnly": "npm run build", 39 | "watch": "tsc -b --watch" 40 | }, 41 | "dependencies": { 42 | "@jupyter-notebook/ui-components": "^7.0.0-alpha.5", 43 | "@jupyterlab/application": "^4.0.0-alpha.10", 44 | "@jupyterlab/apputils": "^4.0.0-alpha.10", 45 | "@jupyterlab/mainmenu": "^4.0.0-alpha.10", 46 | "@jupyterlab/translation": "^4.0.0-alpha.10" 47 | }, 48 | "devDependencies": { 49 | "rimraf": "~3.0.0", 50 | "typescript": "~4.6.3" 51 | }, 52 | "publishConfig": { 53 | "access": "public" 54 | }, 55 | "jupyterlab": { 56 | "extension": true, 57 | "schemaDir": "schema" 58 | }, 59 | "styleModule": "style/index.js" 60 | } 61 | -------------------------------------------------------------------------------- /packages/docmanager-extension/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/docmanager-extension", 3 | "version": "7.0.0-alpha.5", 4 | "description": "Jupyter Notebook - Document Manager Extension", 5 | "homepage": "https://github.com/jupyter/notebook", 6 | "bugs": { 7 | "url": "https://github.com/jupyter/notebook/issues" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/jupyter/notebook.git" 12 | }, 13 | "license": "BSD-3-Clause", 14 | "author": "Project Jupyter", 15 | "sideEffects": [ 16 | "style/**/*.css", 17 | "style/index.js" 18 | ], 19 | "main": "lib/index.js", 20 | "types": "lib/index.d.ts", 21 | "style": "style/index.css", 22 | "directories": { 23 | "lib": "lib/" 24 | }, 25 | "files": [ 26 | "lib/*.d.ts", 27 | "lib/*.js.map", 28 | "lib/*.js", 29 | "schema/*.json", 30 | "style/**/*.css", 31 | "style/index.js" 32 | ], 33 | "scripts": { 34 | "build": "tsc -b", 35 | "build:prod": "tsc -b", 36 | "clean": "rimraf lib && rimraf tsconfig.tsbuildinfo", 37 | "docs": "typedoc src", 38 | "prepublishOnly": "npm run build", 39 | "watch": "tsc -b --watch" 40 | }, 41 | "dependencies": { 42 | "@jupyterlab/application": "^4.0.0-alpha.10", 43 | "@jupyterlab/coreutils": "^6.0.0-alpha.10", 44 | "@jupyterlab/docmanager": "^4.0.0-alpha.10", 45 | "@jupyterlab/docregistry": "^4.0.0-alpha.10", 46 | "@jupyterlab/services": "^7.0.0-alpha.10", 47 | "@lumino/algorithm": "^1.9.1" 48 | }, 49 | "devDependencies": { 50 | "rimraf": "~3.0.0", 51 | "typescript": "~4.6.3" 52 | }, 53 | "publishConfig": { 54 | "access": "public" 55 | }, 56 | "jupyterlab": { 57 | "extension": true 58 | }, 59 | "styleModule": "style/index.js" 60 | } 61 | -------------------------------------------------------------------------------- /packages/application-extension/schema/menus.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Jupyter Notebook Menu Entries", 3 | "description": "Jupyter Notebook Menu Entries", 4 | "jupyter.lab.menus": { 5 | "main": [ 6 | { 7 | "id": "jp-mainmenu-file", 8 | "items": [ 9 | { 10 | "command": "application:rename", 11 | "rank": 4.5 12 | }, 13 | { 14 | "command": "notebook:trust", 15 | "rank": 20 16 | } 17 | ] 18 | }, 19 | { 20 | "id": "jp-mainmenu-view", 21 | "items": [ 22 | { 23 | "type": "submenu", 24 | "disabled": true, 25 | "submenu": { 26 | "id": "jp-mainmenu-view-appearance" 27 | } 28 | } 29 | ] 30 | }, 31 | { 32 | "id": "jp-mainmenu-run", 33 | "items": [ 34 | { 35 | "type": "separator", 36 | "rank": 1000 37 | }, 38 | { 39 | "type": "submenu", 40 | "rank": 1010, 41 | "submenu": { 42 | "id": "jp-runmenu-change-cell-type", 43 | "label": "Cell Type", 44 | "items": [ 45 | { 46 | "command": "notebook:change-cell-to-code", 47 | "rank": 0 48 | }, 49 | { 50 | "command": "notebook:change-cell-to-markdown", 51 | "rank": 0 52 | }, 53 | { 54 | "command": "notebook:change-cell-to-raw", 55 | "rank": 0 56 | } 57 | ] 58 | } 59 | } 60 | ] 61 | } 62 | ] 63 | }, 64 | "properties": {}, 65 | "additionalProperties": false, 66 | "type": "object" 67 | } 68 | -------------------------------------------------------------------------------- /docs/source/ui_components.rst: -------------------------------------------------------------------------------- 1 | User interface components 2 | ========================= 3 | 4 | When opening bug reports or sending emails to the Jupyter mailing list, it is 5 | useful to know the names of different UI components so that other developers 6 | and users have an easier time helping you diagnose your problems. This section 7 | will familiarize you with the names of UI elements within the Notebook and the 8 | different Notebook modes. 9 | 10 | Notebook Dashboard 11 | ------------------- 12 | 13 | When you launch ``jupyter notebook`` the first page that you encounter is the 14 | Notebook Dashboard. 15 | 16 | .. image:: ./_static/images/jupyter-notebook-dashboard.png 17 | 18 | Notebook Editor 19 | --------------- 20 | 21 | Once you've selected a Notebook to edit, the Notebook will open in the Notebook 22 | Editor. 23 | 24 | .. image:: ./_static/images/jupyter-notebook-default.png 25 | 26 | Interactive User Interface Tour of the Notebook 27 | ----------------------------------------------- 28 | 29 | If you would like to learn more about the specific elements within the Notebook 30 | Editor, you can go through the user interface tour by selecting *Help* in the 31 | menubar then selecting *User Interface Tour*. 32 | 33 | Edit Mode and Notebook Editor 34 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 35 | 36 | When a cell is in edit mode, the Cell Mode Indicator will change to reflect 37 | the cell's state. This state is indicated by a small pencil icon on the 38 | top right of the interface. When the cell is in command mode, there is no 39 | icon in that location. 40 | 41 | .. image:: ./_static/images/jupyter-notebook-edit.png 42 | 43 | File Editor 44 | ----------- 45 | 46 | Now let's say that you've chosen to open a Markdown file instead of a Notebook 47 | file whilst in the Notebook Dashboard. If so, the file will be opened in the 48 | File Editor. 49 | 50 | .. image:: ./_static/images/jupyter-file-editor.png 51 | -------------------------------------------------------------------------------- /packages/notebook-extension/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/notebook-extension", 3 | "version": "7.0.0-alpha.5", 4 | "description": "Jupyter Notebook - Notebook Extension", 5 | "homepage": "https://github.com/jupyter/notebook", 6 | "bugs": { 7 | "url": "https://github.com/jupyter/notebook/issues" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/jupyter/notebook.git" 12 | }, 13 | "license": "BSD-3-Clause", 14 | "author": "Project Jupyter", 15 | "sideEffects": [ 16 | "style/**/*.css", 17 | "style/index.js" 18 | ], 19 | "main": "lib/index.js", 20 | "types": "lib/index.d.ts", 21 | "style": "style/index.css", 22 | "directories": { 23 | "lib": "lib/" 24 | }, 25 | "files": [ 26 | "lib/*.d.ts", 27 | "lib/*.js.map", 28 | "lib/*.js", 29 | "schema/*.json", 30 | "style/**/*.css", 31 | "style/index.js" 32 | ], 33 | "scripts": { 34 | "build": "tsc -b", 35 | "build:prod": "tsc -b", 36 | "clean": "rimraf lib && rimraf tsconfig.tsbuildinfo", 37 | "docs": "typedoc src", 38 | "prepublishOnly": "npm run build", 39 | "watch": "tsc -b --watch" 40 | }, 41 | "dependencies": { 42 | "@jupyter-notebook/application": "^7.0.0-alpha.5", 43 | "@jupyterlab/application": "^4.0.0-alpha.10", 44 | "@jupyterlab/apputils": "^4.0.0-alpha.10", 45 | "@jupyterlab/cells": "^4.0.0-alpha.10", 46 | "@jupyterlab/docmanager": "^4.0.0-alpha.10", 47 | "@jupyterlab/notebook": "^4.0.0-alpha.10", 48 | "@jupyterlab/settingregistry": "^4.0.0-alpha.10", 49 | "@jupyterlab/translation": "^4.0.0-alpha.10", 50 | "@lumino/polling": "^1.10.0", 51 | "@lumino/widgets": "^1.32.0" 52 | }, 53 | "devDependencies": { 54 | "rimraf": "~3.0.0", 55 | "typescript": "~4.6.3" 56 | }, 57 | "publishConfig": { 58 | "access": "public" 59 | }, 60 | "jupyterlab": { 61 | "extension": true, 62 | "schemaDir": "schema" 63 | }, 64 | "styleModule": "style/index.js" 65 | } 66 | -------------------------------------------------------------------------------- /ui-tests/test/editor.spec.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | import path from 'path'; 5 | 6 | import { test } from './fixtures'; 7 | 8 | import { expect } from '@playwright/test'; 9 | 10 | const FILE = 'environment.yml'; 11 | 12 | test.use({ autoGoto: false }); 13 | 14 | const processRenameDialog = async (page, prevName: string, newName: string) => { 15 | // Rename in the input dialog 16 | await page.fill( 17 | `//div[normalize-space(.)='File Path${prevName}New Name']/input`, 18 | newName 19 | ); 20 | 21 | await Promise.all([ 22 | await page.click('text="Rename"'), 23 | // wait until the URL is updated 24 | await page.waitForNavigation() 25 | ]); 26 | }; 27 | 28 | test.describe('Editor', () => { 29 | test.beforeEach(async ({ page, tmpPath }) => { 30 | await page.contents.uploadFile( 31 | path.resolve(__dirname, `../../binder/${FILE}`), 32 | `${tmpPath}/${FILE}` 33 | ); 34 | }); 35 | 36 | test('Renaming the file by clicking on the title', async ({ 37 | page, 38 | tmpPath 39 | }) => { 40 | const file = `${tmpPath}/${FILE}`; 41 | await page.goto(`edit/${file}`); 42 | 43 | // Click on the title 44 | await page.click(`text="${FILE}"`); 45 | 46 | const newName = 'test.yml'; 47 | await processRenameDialog(page, file, newName); 48 | 49 | // Check the URL contains the new name 50 | const url = page.url(); 51 | expect(url).toContain(newName); 52 | }); 53 | 54 | test('Renaming the file via the menu entry', async ({ page, tmpPath }) => { 55 | const file = `${tmpPath}/${FILE}`; 56 | await page.goto(`edit/${file}`); 57 | 58 | // Click on the title 59 | await page.menu.clickMenuItem('File>Rename…'); 60 | 61 | // Rename in the input dialog 62 | const newName = 'test.yml'; 63 | 64 | await processRenameDialog(page, file, newName); 65 | 66 | // Check the URL contains the new name 67 | const url = page.url(); 68 | expect(url).toContain(newName); 69 | }); 70 | }); 71 | -------------------------------------------------------------------------------- /docs/source/links.txt: -------------------------------------------------------------------------------- 1 | .. This (-*- rst -*-) format file contains commonly used link targets 2 | and name substitutions. It may be included in many files, 3 | therefore it should only contain link targets and name 4 | substitutions. Try grepping for "^\.\. _" to find plausible 5 | candidates for this list. 6 | 7 | NOTE: this file must have an extension *opposite* to that of the main reST 8 | files in the manuals, so that we can include it with ".. include::" 9 | directives, but without triggering warnings from Sphinx for not being listed 10 | in any toctree. Since IPython uses .txt for the main files, this one will 11 | use .rst. 12 | 13 | NOTE: reST targets are 14 | __not_case_sensitive__, so only one target definition is needed for 15 | ipython, IPython, etc. 16 | 17 | NOTE: Some of these were taken from the nipy links compendium. 18 | 19 | .. Main Jupyter notebook links 20 | 21 | .. _Notebook Basics: notebook_p2_ 22 | .. _notebook_p2: https://nbviewer.jupyter.org/github/jupyter/notebook/blob/main/docs/source/examples/Notebook/Notebook%20Basics.ipynb 23 | 24 | .. _Running Code in the Jupyter Notebook: notebook_p1_ 25 | .. _notebook_p1: https://nbviewer.jupyter.org/github/jupyter/notebook/blob/main/docs/source/examples/Notebook/Running%20Code.ipynb 26 | 27 | .. Other python projects 28 | .. _matplotlib: https://matplotlib.org 29 | .. _nbviewer: https://nbviewer.jupyter.org 30 | .. _nbconvert: https://nbconvert.readthedocs.io/en/latest/ 31 | 32 | .. Other tools and projects 33 | .. _Markdown: https://daringfireball.net/projects/markdown/syntax 34 | 35 | .. _Rich Output: notebook_p5_ 36 | .. _notebook_p5: https://nbviewer.jupyter.org/github/ipython/ipython/blob/main/examples/IPython%20Kernel/Rich%20Output.ipynb 37 | 38 | .. _Plotting with Matplotlib: notebook_p3_ 39 | .. _notebook_p3: https://nbviewer.jupyter.org/github/ipython/ipython/blob/main/examples/IPython%20Kernel/Plotting%20in%20the%20Notebook.ipynb 40 | 41 | .. _Working with Markdown Cells: https://nbviewer.jupyter.org/github/jupyter/notebook/blob/main/docs/source/examples/Notebook/Working%20With%20Markdown%20Cells.ipynb 42 | -------------------------------------------------------------------------------- /packages/tree/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/tree", 3 | "version": "7.0.0-alpha.5", 4 | "description": "Jupyter Notebook - Tree", 5 | "homepage": "https://github.com/jupyter/notebook", 6 | "bugs": { 7 | "url": "https://github.com/jupyter/notebook/issues" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/jupyter/notebook.git" 12 | }, 13 | "license": "BSD-3-Clause", 14 | "author": "Project Jupyter", 15 | "sideEffects": [ 16 | "style/**/*.css", 17 | "style/index.js" 18 | ], 19 | "main": "lib/index.js", 20 | "types": "lib/index.d.ts", 21 | "style": "style/index.css", 22 | "directories": { 23 | "lib": "lib/" 24 | }, 25 | "files": [ 26 | "lib/*.d.ts", 27 | "lib/*.js.map", 28 | "lib/*.js", 29 | "schema/*.json", 30 | "style/**/*.css", 31 | "style/index.js" 32 | ], 33 | "scripts": { 34 | "build": "tsc -b", 35 | "build:prod": "tsc -b", 36 | "clean": "rimraf lib && rimraf tsconfig.tsbuildinfo", 37 | "docs": "typedoc src", 38 | "prepublishOnly": "npm run build", 39 | "watch": "tsc -b --watch" 40 | }, 41 | "dependencies": { 42 | "@jupyter-notebook/application": "^7.0.0-alpha.5", 43 | "@jupyterlab/application": "^4.0.0-alpha.10", 44 | "@jupyterlab/apputils": "^4.0.0-alpha.10", 45 | "@jupyterlab/coreutils": "^6.0.0-alpha.10", 46 | "@jupyterlab/docmanager": "^4.0.0-alpha.10", 47 | "@jupyterlab/filebrowser": "^4.0.0-alpha.10", 48 | "@jupyterlab/mainmenu": "^4.0.0-alpha.10", 49 | "@jupyterlab/services": "^7.0.0-alpha.10", 50 | "@jupyterlab/settingregistry": "^4.0.0-alpha.10", 51 | "@jupyterlab/statedb": "^4.0.0-alpha.10", 52 | "@jupyterlab/translation": "^4.0.0-alpha.10", 53 | "@jupyterlab/ui-components": "^4.0.0-alpha.25", 54 | "@lumino/algorithm": "^1.9.1", 55 | "@lumino/commands": "^1.20.0", 56 | "@lumino/widgets": "^1.32.0" 57 | }, 58 | "devDependencies": { 59 | "rimraf": "~3.0.0", 60 | "typescript": "~4.6.3" 61 | }, 62 | "publishConfig": { 63 | "access": "public" 64 | }, 65 | "styleModule": "style/index.js" 66 | } 67 | -------------------------------------------------------------------------------- /packages/documentsearch-extension/src/index.ts: -------------------------------------------------------------------------------- 1 | import { 2 | JupyterFrontEnd, 3 | JupyterFrontEndPlugin 4 | } from '@jupyterlab/application'; 5 | 6 | import { ISearchProviderRegistry } from '@jupyterlab/documentsearch'; 7 | 8 | import { Widget } from '@lumino/widgets'; 9 | 10 | import { INotebookShell } from '@jupyter-notebook/application'; 11 | 12 | const SEARCHABLE_CLASS = 'jp-mod-searchable'; 13 | 14 | /** 15 | * A plugin to add document search functionalities. 16 | */ 17 | const notebookShellWidgetListener: JupyterFrontEndPlugin = { 18 | id: '@jupyter-notebook/documentsearch-extension:notebookShellWidgetListener', 19 | requires: [INotebookShell, ISearchProviderRegistry], 20 | autoStart: true, 21 | activate: ( 22 | app: JupyterFrontEnd, 23 | notebookShell: INotebookShell, 24 | registry: ISearchProviderRegistry 25 | ) => { 26 | // If a given widget is searchable, apply the searchable class. 27 | // If it's not searchable, remove the class. 28 | const transformWidgetSearchability = (widget: Widget | null) => { 29 | if (!widget) { 30 | return; 31 | } 32 | if (registry.hasProvider(widget)) { 33 | widget.addClass(SEARCHABLE_CLASS); 34 | } else { 35 | widget.removeClass(SEARCHABLE_CLASS); 36 | } 37 | }; 38 | 39 | // Update searchability of the active widget when the registry 40 | // changes, in case a provider for the current widget was added 41 | // or removed 42 | registry.changed.connect(() => 43 | transformWidgetSearchability(notebookShell.currentWidget) 44 | ); 45 | 46 | // Apply the searchable class only to the active widget if it is actually 47 | // searchable. Remove the searchable class from a widget when it's 48 | // no longer active. 49 | notebookShell.currentChanged.connect((_, args) => { 50 | if (notebookShell.currentWidget) { 51 | transformWidgetSearchability(notebookShell.currentWidget); 52 | } 53 | }); 54 | } 55 | }; 56 | 57 | /** 58 | * Export the plugins as default. 59 | */ 60 | const plugins: JupyterFrontEndPlugin[] = [notebookShellWidgetListener]; 61 | 62 | export default plugins; 63 | -------------------------------------------------------------------------------- /packages/docmanager-extension/src/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | import { 5 | JupyterFrontEnd, 6 | JupyterFrontEndPlugin 7 | } from '@jupyterlab/application'; 8 | 9 | import { PageConfig, PathExt } from '@jupyterlab/coreutils'; 10 | 11 | import { IDocumentManager } from '@jupyterlab/docmanager'; 12 | 13 | import { IDocumentWidget, DocumentRegistry } from '@jupyterlab/docregistry'; 14 | 15 | import { Kernel } from '@jupyterlab/services'; 16 | 17 | /** 18 | * A plugin to open document in a new browser tab. 19 | * 20 | * TODO: remove and use a custom doc manager? 21 | */ 22 | const opener: JupyterFrontEndPlugin = { 23 | id: '@jupyter-notebook/docmanager-extension:opener', 24 | requires: [IDocumentManager], 25 | autoStart: true, 26 | activate: (app: JupyterFrontEnd, docManager: IDocumentManager) => { 27 | const baseUrl = PageConfig.getBaseUrl(); 28 | 29 | // patch the `docManager.open` option to prevent the default behavior 30 | const docOpen = docManager.open; 31 | docManager.open = ( 32 | path: string, 33 | widgetName = 'default', 34 | kernel?: Partial, 35 | options?: DocumentRegistry.IOpenOptions 36 | ): IDocumentWidget | undefined => { 37 | const ref = options?.ref; 38 | if (ref === '_noref') { 39 | docOpen.call(docManager, path, widgetName, kernel, options); 40 | return; 41 | } 42 | const ext = PathExt.extname(path); 43 | let route = 'edit'; 44 | if ( 45 | (widgetName === 'default' && ext === '.ipynb') || 46 | widgetName === 'Notebook' 47 | ) { 48 | route = 'notebooks'; 49 | } 50 | let url = `${baseUrl}${route}/${path}`; 51 | // append ?factory only if it's not the default 52 | if (widgetName !== 'default') { 53 | url = `${url}?factory=${widgetName}`; 54 | } 55 | window.open(url); 56 | return undefined; 57 | }; 58 | } 59 | }; 60 | 61 | /** 62 | * Export the plugins as default. 63 | */ 64 | const plugins: JupyterFrontEndPlugin[] = [opener]; 65 | 66 | export default plugins; 67 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | ci: 2 | # skip any check that needs internet access 3 | skip: [prettier, integrity] 4 | 5 | repos: 6 | - repo: https://github.com/pre-commit/pre-commit-hooks 7 | rev: v4.3.0 8 | hooks: 9 | - id: forbid-new-submodules 10 | - id: end-of-file-fixer 11 | - id: check-case-conflict 12 | - id: check-executables-have-shebangs 13 | - id: requirements-txt-fixer 14 | - id: check-added-large-files 15 | - id: check-case-conflict 16 | - id: check-toml 17 | - id: check-yaml 18 | - id: debug-statements 19 | - id: check-builtin-literals 20 | - id: trailing-whitespace 21 | exclude: .bumpversion.cfg 22 | 23 | - repo: https://github.com/psf/black 24 | rev: 22.8.0 25 | hooks: 26 | - id: black 27 | args: ["--line-length", "100"] 28 | 29 | - repo: https://github.com/PyCQA/isort 30 | rev: 5.10.1 31 | hooks: 32 | - id: isort 33 | files: \.py$ 34 | args: [--profile=black] 35 | 36 | - repo: https://github.com/PyCQA/doc8 37 | rev: v1.0.0 38 | hooks: 39 | - id: doc8 40 | args: [--max-line-length=200] 41 | stages: [manual] 42 | 43 | - repo: https://github.com/pycqa/flake8 44 | rev: 5.0.4 45 | hooks: 46 | - id: flake8 47 | additional_dependencies: 48 | [ 49 | "flake8-bugbear==22.6.22", 50 | "flake8-implicit-str-concat==0.2.0", 51 | ] 52 | stages: [manual] 53 | 54 | - repo: https://github.com/sirosen/check-jsonschema 55 | rev: 0.18.2 56 | hooks: 57 | - id: check-jsonschema 58 | name: 'Check GitHub Workflows' 59 | files: ^\.github/workflows/ 60 | types: [yaml] 61 | args: ['--schemafile', 'https://json.schemastore.org/github-workflow'] 62 | stages: [manual] 63 | 64 | - repo: local 65 | hooks: 66 | - id: prettier 67 | name: prettier 68 | entry: 'npm run prettier:files' 69 | language: node 70 | types_or: [json, markdown, ts, tsx, javascript, jsx, css] 71 | - id: integrity 72 | name: integrity 73 | entry: 'npm run integrity --force' 74 | language: node 75 | stages: [push] 76 | -------------------------------------------------------------------------------- /packages/ui-components/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/ui-components", 3 | "version": "7.0.0-alpha.5", 4 | "description": "Jupyter Notebook - UI components", 5 | "homepage": "https://github.com/jupyter/notebook", 6 | "bugs": { 7 | "url": "https://github.com/jupyter/notebook/issues" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/jupyter/notebook.git" 12 | }, 13 | "license": "BSD-3-Clause", 14 | "author": "Project Jupyter", 15 | "sideEffects": [ 16 | "style/**/*", 17 | "style/index.js" 18 | ], 19 | "main": "lib/index.js", 20 | "types": "lib/index.d.ts", 21 | "style": "style/index.css", 22 | "directories": { 23 | "lib": "lib/" 24 | }, 25 | "files": [ 26 | "lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}", 27 | "style/**/*.{css,eot,gif,html,jpg,json,png,svg,woff2,ttf}", 28 | "style/index.js" 29 | ], 30 | "scripts": { 31 | "build": "tsc -b", 32 | "build:prod": "tsc -b", 33 | "build:test": "tsc --build tsconfig.test.json", 34 | "clean": "rimraf lib && rimraf tsconfig.tsbuildinfo", 35 | "cleansvg": "svgo --config svgo.yaml", 36 | "docs": "typedoc src", 37 | "docs:init": "bash docs/build.sh", 38 | "prepublishOnly": "npm run build", 39 | "test": "jest", 40 | "test:cov": "jest --collect-coverage", 41 | "test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand", 42 | "test:debug:watch": "node --inspect-brk node_modules/.bin/jest --runInBand --watch", 43 | "watch": "tsc -b --watch" 44 | }, 45 | "dependencies": { 46 | "@jupyterlab/ui-components": "^4.0.0-alpha.25", 47 | "react": "^17.0.1", 48 | "react-dom": "^17.0.1" 49 | }, 50 | "devDependencies": { 51 | "@babel/core": "^7.10.2", 52 | "@babel/preset-env": "^7.10.2", 53 | "@jupyterlab/testutils": "^4.0.0-alpha.10", 54 | "@types/jest": "^26.0.10", 55 | "babel-loader": "^8.0.6", 56 | "jest": "^26.4.2", 57 | "rimraf": "~3.0.0", 58 | "ts-jest": "^26.3.0", 59 | "typescript": "~4.6.3" 60 | }, 61 | "publishConfig": { 62 | "access": "public" 63 | }, 64 | "jupyterlab": { 65 | "coreDependency": true 66 | }, 67 | "styleModule": "style/index.js" 68 | } 69 | -------------------------------------------------------------------------------- /packages/application/style/base.css: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | | Copyright (c) Jupyter Development Team. 3 | | Distributed under the terms of the Modified BSD License. 4 | |----------------------------------------------------------------------------*/ 5 | 6 | :root { 7 | --jp-private-topbar-height: 28px; 8 | /* Override the layout-2 color for the dark theme */ 9 | --md-grey-800: #323232; 10 | --jp-notebook-max-width: 1200px; 11 | } 12 | 13 | body { 14 | margin: 0; 15 | padding: 0; 16 | background: var(--jp-layout-color2); 17 | } 18 | 19 | #main { 20 | position: absolute; 21 | top: 0; 22 | left: 0; 23 | right: 0; 24 | bottom: 0; 25 | } 26 | 27 | #top-panel-wrapper { 28 | min-height: calc(1.5 * var(--jp-private-topbar-height)); 29 | border-bottom: var(--jp-border-width) solid var(--jp-border-color0); 30 | background: var(--jp-layout-color1); 31 | } 32 | 33 | #top-panel { 34 | display: flex; 35 | min-height: calc(1.5 * var(--jp-private-topbar-height)); 36 | padding-left: 5px; 37 | padding-right: 5px; 38 | margin-left: auto; 39 | margin-right: auto; 40 | max-width: 1200px; 41 | } 42 | 43 | #menu-panel-wrapper { 44 | min-height: var(--jp-private-topbar-height); 45 | background: var(--jp-layout-color1); 46 | border-bottom: var(--jp-border-width) solid var(--jp-border-color0); 47 | box-shadow: var(--jp-elevation-z1); 48 | } 49 | 50 | #menu-panel { 51 | display: flex; 52 | min-height: var(--jp-private-topbar-height); 53 | background: var(--jp-layout-color1); 54 | padding-left: 5px; 55 | padding-right: 5px; 56 | margin-left: auto; 57 | margin-right: auto; 58 | max-width: var(--jp-notebook-max-width); 59 | } 60 | 61 | #main-panel { 62 | box-shadow: var(--jp-elevation-z4); 63 | margin-left: auto; 64 | margin-right: auto; 65 | max-width: var(--jp-notebook-max-width); 66 | } 67 | 68 | #spacer-widget { 69 | min-height: 16px; 70 | } 71 | 72 | /* Special case notebooks as document oriented pages */ 73 | 74 | body[data-notebook='notebooks'] #main-panel { 75 | margin-left: unset; 76 | margin-right: unset; 77 | max-width: unset; 78 | } 79 | 80 | body[data-notebook='notebooks'] #spacer-widget { 81 | min-height: unset; 82 | } 83 | -------------------------------------------------------------------------------- /packages/tree-extension/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/tree-extension", 3 | "version": "7.0.0-alpha.5", 4 | "description": "Jupyter Notebook - Tree Extension", 5 | "homepage": "https://github.com/jupyter/notebook", 6 | "bugs": { 7 | "url": "https://github.com/jupyter/notebook/issues" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/jupyter/notebook.git" 12 | }, 13 | "license": "BSD-3-Clause", 14 | "author": "Project Jupyter", 15 | "sideEffects": [ 16 | "style/**/*.css", 17 | "style/index.js" 18 | ], 19 | "main": "lib/index.js", 20 | "types": "lib/index.d.ts", 21 | "style": "style/index.css", 22 | "directories": { 23 | "lib": "lib/" 24 | }, 25 | "files": [ 26 | "lib/*.d.ts", 27 | "lib/*.js.map", 28 | "lib/*.js", 29 | "schema/*.json", 30 | "style/**/*.css", 31 | "style/index.js" 32 | ], 33 | "scripts": { 34 | "build": "tsc -b", 35 | "build:prod": "tsc -b", 36 | "clean": "rimraf lib && rimraf tsconfig.tsbuildinfo", 37 | "docs": "typedoc src", 38 | "prepublishOnly": "npm run build", 39 | "watch": "tsc -b --watch" 40 | }, 41 | "dependencies": { 42 | "@jupyter-notebook/application": "^7.0.0-alpha.5", 43 | "@jupyter-notebook/tree": "^7.0.0-alpha.5", 44 | "@jupyterlab/application": "^4.0.0-alpha.10", 45 | "@jupyterlab/apputils": "^4.0.0-alpha.10", 46 | "@jupyterlab/coreutils": "^6.0.0-alpha.10", 47 | "@jupyterlab/docmanager": "^4.0.0-alpha.10", 48 | "@jupyterlab/filebrowser": "^4.0.0-alpha.10", 49 | "@jupyterlab/mainmenu": "^4.0.0-alpha.10", 50 | "@jupyterlab/services": "^7.0.0-alpha.10", 51 | "@jupyterlab/settingregistry": "^4.0.0-alpha.10", 52 | "@jupyterlab/statedb": "^4.0.0-alpha.10", 53 | "@jupyterlab/translation": "^4.0.0-alpha.10", 54 | "@jupyterlab/ui-components": "^4.0.0-alpha.25", 55 | "@lumino/algorithm": "^1.9.1", 56 | "@lumino/commands": "^1.20.0", 57 | "@lumino/widgets": "^1.32.0" 58 | }, 59 | "devDependencies": { 60 | "rimraf": "~3.0.0", 61 | "typescript": "~4.6.3" 62 | }, 63 | "publishConfig": { 64 | "access": "public" 65 | }, 66 | "jupyterlab": { 67 | "extension": true, 68 | "schemaDir": "schema" 69 | }, 70 | "styleModule": "style/index.js" 71 | } 72 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.bundle.* 2 | lib/ 3 | node_modules/ 4 | *.egg-info/ 5 | .ipynb_checkpoints 6 | *.tsbuildinfo 7 | 8 | # Created by https://www.gitignore.io/api/python 9 | # Edit at https://www.gitignore.io/?templates=python 10 | 11 | ### Python ### 12 | # Byte-compiled / optimized / DLL files 13 | __pycache__/ 14 | *.py[cod] 15 | *$py.class 16 | 17 | # C extensions 18 | *.so 19 | 20 | # Distribution / packaging 21 | .Python 22 | build/ 23 | develop-eggs/ 24 | dist/ 25 | downloads/ 26 | eggs/ 27 | .eggs/ 28 | lib/ 29 | lib64/ 30 | parts/ 31 | sdist/ 32 | var/ 33 | wheels/ 34 | pip-wheel-metadata/ 35 | share/python-wheels/ 36 | .installed.cfg 37 | *.egg 38 | MANIFEST 39 | 40 | # PyInstaller 41 | # Usually these files are written by a python script from a template 42 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 43 | *.manifest 44 | *.spec 45 | 46 | # Installer logs 47 | pip-log.txt 48 | pip-delete-this-directory.txt 49 | 50 | # Unit test / coverage reports 51 | htmlcov/ 52 | .tox/ 53 | .nox/ 54 | .coverage 55 | .coverage.* 56 | .cache 57 | nosetests.xml 58 | coverage.xml 59 | *.cover 60 | .hypothesis/ 61 | .pytest_cache/ 62 | 63 | # Translations 64 | *.mo 65 | *.pot 66 | 67 | # Scrapy stuff: 68 | .scrapy 69 | 70 | # Sphinx documentation 71 | docs/_build/ 72 | 73 | # PyBuilder 74 | target/ 75 | 76 | # pyenv 77 | .python-version 78 | 79 | # celery beat schedule file 80 | celerybeat-schedule 81 | 82 | # SageMath parsed files 83 | *.sage.py 84 | 85 | # Spyder project settings 86 | .spyderproject 87 | .spyproject 88 | 89 | # Rope project settings 90 | .ropeproject 91 | 92 | # Mr Developer 93 | .mr.developer.cfg 94 | .project 95 | .pydevproject 96 | 97 | # mkdocs documentation 98 | /site 99 | 100 | # mypy 101 | .mypy_cache/ 102 | .dmypy.json 103 | dmypy.json 104 | 105 | # Pyre type checker 106 | .pyre/ 107 | 108 | # OS X stuff 109 | *.DS_Store 110 | 111 | # End of https://www.gitignore.io/api/python 112 | 113 | _temp_extension 114 | junit.xml 115 | [uU]ntitled* 116 | notebook/static/* 117 | !notebook/static/favicons 118 | notebook/labextension 119 | notebook/schemas 120 | docs/source/changelog.md 121 | docs/source/contributing.md 122 | 123 | # playwright 124 | ui-tests/test-results 125 | ui-tests/playwright-report 126 | 127 | # VSCode 128 | .vscode 129 | -------------------------------------------------------------------------------- /packages/application-extension/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/application-extension", 3 | "version": "7.0.0-alpha.5", 4 | "description": "Jupyter Notebook - Application Extension", 5 | "homepage": "https://github.com/jupyter/notebook", 6 | "bugs": { 7 | "url": "https://github.com/jupyter/notebook/issues" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/jupyter/notebook.git" 12 | }, 13 | "license": "BSD-3-Clause", 14 | "author": "Project Jupyter", 15 | "sideEffects": [ 16 | "style/**/*.css", 17 | "style/index.js" 18 | ], 19 | "main": "lib/index.js", 20 | "types": "lib/index.d.ts", 21 | "style": "style/index.css", 22 | "directories": { 23 | "lib": "lib/" 24 | }, 25 | "files": [ 26 | "lib/*.d.ts", 27 | "lib/*.js.map", 28 | "lib/*.js", 29 | "schema/*.json", 30 | "style/**/*.css", 31 | "style/index.js" 32 | ], 33 | "scripts": { 34 | "build": "tsc -b", 35 | "build:prod": "tsc -b", 36 | "clean": "rimraf lib && rimraf tsconfig.tsbuildinfo", 37 | "docs": "typedoc src", 38 | "prepublishOnly": "npm run build", 39 | "watch": "tsc -b --watch" 40 | }, 41 | "dependencies": { 42 | "@jupyter-notebook/application": "^7.0.0-alpha.5", 43 | "@jupyter-notebook/ui-components": "^7.0.0-alpha.5", 44 | "@jupyterlab/application": "^4.0.0-alpha.10", 45 | "@jupyterlab/apputils": "^4.0.0-alpha.10", 46 | "@jupyterlab/celltags": "^4.0.0-alpha.10", 47 | "@jupyterlab/codeeditor": "^4.0.0-alpha.10", 48 | "@jupyterlab/codemirror": "^4.0.0-alpha.10", 49 | "@jupyterlab/console": "^4.0.0-alpha.10", 50 | "@jupyterlab/coreutils": "^6.0.0-alpha.10", 51 | "@jupyterlab/docmanager": "^4.0.0-alpha.10", 52 | "@jupyterlab/docregistry": "^4.0.0-alpha.10", 53 | "@jupyterlab/mainmenu": "^4.0.0-alpha.10", 54 | "@jupyterlab/settingregistry": "^4.0.0-alpha.10", 55 | "@jupyterlab/translation": "^4.0.0-alpha.10", 56 | "@lumino/coreutils": "^1.12.0", 57 | "@lumino/disposable": "^1.10.1", 58 | "@lumino/widgets": "^1.32.0" 59 | }, 60 | "devDependencies": { 61 | "rimraf": "~3.0.0", 62 | "typescript": "~4.6.3" 63 | }, 64 | "publishConfig": { 65 | "access": "public" 66 | }, 67 | "jupyterlab": { 68 | "extension": true, 69 | "schemaDir": "schema" 70 | }, 71 | "styleModule": "style/index.js" 72 | } 73 | -------------------------------------------------------------------------------- /packages/lab-extension/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/lab-extension", 3 | "version": "7.0.0-alpha.5", 4 | "description": "Jupyter Notebook - Lab Extension", 5 | "homepage": "https://github.com/jupyter/notebook", 6 | "bugs": { 7 | "url": "https://github.com/jupyter/notebook/issues" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/jupyter/notebook.git" 12 | }, 13 | "license": "BSD-3-Clause", 14 | "author": "Project Jupyter", 15 | "sideEffects": [ 16 | "style/**/*.css", 17 | "style/index.js" 18 | ], 19 | "main": "lib/index.js", 20 | "types": "lib/index.d.ts", 21 | "style": "style/index.css", 22 | "directories": { 23 | "lib": "lib/" 24 | }, 25 | "files": [ 26 | "lib/*.d.ts", 27 | "lib/*.js.map", 28 | "lib/*.js", 29 | "schema/*.json", 30 | "style/index.js" 31 | ], 32 | "scripts": { 33 | "build": "jlpm run build:lib && jlpm run build:labextension:dev", 34 | "build:labextension": "jupyter labextension build .", 35 | "build:labextension:dev": "jupyter labextension build --development True .", 36 | "build:lib": "tsc", 37 | "build:prod": "jlpm run build:lib && jlpm run build:labextension", 38 | "clean": "jlpm run clean:lib && jlpm run clean:labextension", 39 | "clean:labextension": "rimraf ../../notebook/labextension", 40 | "clean:lib": "rimraf lib tsconfig.tsbuildinfo", 41 | "watch": "run-p watch:src watch:labextension", 42 | "watch:labextension": "jupyter labextension watch .", 43 | "watch:src": "tsc -w" 44 | }, 45 | "dependencies": { 46 | "@jupyter-notebook/application": "^7.0.0-alpha.5", 47 | "@jupyterlab/application": "^4.0.0-alpha.10", 48 | "@jupyterlab/apputils": "^4.0.0-alpha.10", 49 | "@jupyterlab/coreutils": "^6.0.0-alpha.10", 50 | "@jupyterlab/docregistry": "^4.0.0-alpha.10", 51 | "@jupyterlab/notebook": "^4.0.0-alpha.10", 52 | "@jupyterlab/translation": "^4.0.0-alpha.10", 53 | "@lumino/commands": "^1.20.0", 54 | "@lumino/disposable": "^1.10.1" 55 | }, 56 | "devDependencies": { 57 | "@jupyterlab/builder": "^4.0.0-alpha.10", 58 | "rimraf": "~3.0.0", 59 | "typescript": "~4.6.3" 60 | }, 61 | "publishConfig": { 62 | "access": "public" 63 | }, 64 | "jupyterlab": { 65 | "extension": true, 66 | "outputDir": "../../notebook/labextension", 67 | "schemaDir": "schema" 68 | }, 69 | "styleModule": "style/index.js" 70 | } 71 | -------------------------------------------------------------------------------- /packages/application/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/application", 3 | "version": "7.0.0-alpha.5", 4 | "description": "Jupyter Notebook - Application", 5 | "homepage": "https://github.com/jupyter/notebook", 6 | "bugs": { 7 | "url": "https://github.com/jupyter/notebook/issues" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/jupyter/notebook.git" 12 | }, 13 | "license": "BSD-3-Clause", 14 | "author": "Project Jupyter", 15 | "sideEffects": [ 16 | "style/*.css", 17 | "style/index.js" 18 | ], 19 | "main": "lib/index.js", 20 | "types": "lib/index.d.ts", 21 | "style": "style/index.css", 22 | "directories": { 23 | "lib": "lib/" 24 | }, 25 | "files": [ 26 | "lib/*.d.ts", 27 | "lib/*.js.map", 28 | "lib/*.js", 29 | "style/*.css", 30 | "style/index.js" 31 | ], 32 | "scripts": { 33 | "build": "tsc -b", 34 | "build:prod": "tsc -b", 35 | "build:test": "tsc --build tsconfig.test.json", 36 | "clean": "rimraf lib && rimraf tsconfig.tsbuildinfo", 37 | "docs": "typedoc src", 38 | "prepublishOnly": "npm run build", 39 | "test": "jest", 40 | "test:cov": "jest --collect-coverage", 41 | "test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand", 42 | "test:debug:watch": "node --inspect-brk node_modules/.bin/jest --runInBand --watch", 43 | "watch": "tsc -b --watch" 44 | }, 45 | "dependencies": { 46 | "@jupyterlab/application": "^4.0.0-alpha.10", 47 | "@jupyterlab/coreutils": "^6.0.0-alpha.10", 48 | "@jupyterlab/docregistry": "^4.0.0-alpha.10", 49 | "@jupyterlab/rendermime-interfaces": "^3.8.0-alpha.10", 50 | "@jupyterlab/ui-components": "^4.0.0-alpha.25", 51 | "@lumino/algorithm": "^1.9.1", 52 | "@lumino/coreutils": "^1.12.0", 53 | "@lumino/messaging": "^1.10.1", 54 | "@lumino/polling": "^1.10.0", 55 | "@lumino/signaling": "^1.10.1", 56 | "@lumino/widgets": "^1.32.0" 57 | }, 58 | "devDependencies": { 59 | "@babel/core": "^7.11.6", 60 | "@babel/preset-env": "^7.12.1", 61 | "@jupyterlab/testutils": "^4.0.0-alpha.10", 62 | "@types/jest": "^26.0.10", 63 | "jest": "^26.4.2", 64 | "rimraf": "~3.0.0", 65 | "ts-jest": "^26.3.0", 66 | "typescript": "~4.6.3" 67 | }, 68 | "publishConfig": { 69 | "access": "public" 70 | }, 71 | "jupyterlab": { 72 | "coreDependency": true 73 | }, 74 | "styleModule": "style/index.js" 75 | } 76 | -------------------------------------------------------------------------------- /packages/console-extension/src/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | import { 5 | IRouter, 6 | JupyterFrontEnd, 7 | JupyterFrontEndPlugin 8 | } from '@jupyterlab/application'; 9 | 10 | import { IConsoleTracker } from '@jupyterlab/console'; 11 | 12 | import { PageConfig } from '@jupyterlab/coreutils'; 13 | 14 | import { find } from '@lumino/algorithm'; 15 | 16 | /** 17 | * A plugin to open consoles in a new tab 18 | */ 19 | const opener: JupyterFrontEndPlugin = { 20 | id: '@jupyter-notebook/console-extension:opener', 21 | requires: [IRouter], 22 | autoStart: true, 23 | activate: (app: JupyterFrontEnd, router: IRouter) => { 24 | const { commands } = app; 25 | const consolePattern = new RegExp('/consoles/(.*)'); 26 | 27 | const command = 'router:console'; 28 | commands.addCommand(command, { 29 | execute: (args: any) => { 30 | const parsed = args as IRouter.ILocation; 31 | const matches = parsed.path.match(consolePattern); 32 | if (!matches) { 33 | return; 34 | } 35 | const [, match] = matches; 36 | if (!match) { 37 | return; 38 | } 39 | 40 | const path = decodeURIComponent(match); 41 | commands.execute('console:create', { path }); 42 | } 43 | }); 44 | 45 | router.register({ command, pattern: consolePattern }); 46 | } 47 | }; 48 | 49 | /** 50 | * Open consoles in a new tab. 51 | */ 52 | const redirect: JupyterFrontEndPlugin = { 53 | id: '@jupyter-notebook/console-extension:redirect', 54 | requires: [IConsoleTracker], 55 | autoStart: true, 56 | activate: (app: JupyterFrontEnd, tracker: IConsoleTracker) => { 57 | const baseUrl = PageConfig.getBaseUrl(); 58 | tracker.widgetAdded.connect(async (send, console) => { 59 | const { sessionContext } = console; 60 | await sessionContext.ready; 61 | const widget = find(app.shell.widgets('main'), w => w.id === console.id); 62 | if (widget) { 63 | // bail if the console is already added to the main area 64 | return; 65 | } 66 | window.open(`${baseUrl}consoles/${sessionContext.path}`, '_blank'); 67 | 68 | // the widget is not needed anymore 69 | console.dispose(); 70 | }); 71 | } 72 | }; 73 | 74 | /** 75 | * Export the plugins as default. 76 | */ 77 | const plugins: JupyterFrontEndPlugin[] = [opener, redirect]; 78 | 79 | export default plugins; 80 | -------------------------------------------------------------------------------- /packages/tree-extension/schema/widget.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "File Browser Widget", 3 | "description": "File Browser widget settings.", 4 | "jupyter.lab.toolbars": { 5 | "FileBrowser": [ 6 | { "name": "spacer", "type": "spacer", "rank": 900 }, 7 | { "name": "new-dropdown", "rank": 1000 }, 8 | { "name": "uploader", "rank": 1010 }, 9 | { "name": "refresh", "command": "filebrowser:refresh", "rank": 1020 } 10 | ] 11 | }, 12 | "jupyter.lab.transform": true, 13 | "properties": { 14 | "toolbar": { 15 | "title": "File browser toolbar items", 16 | "description": "Note: To disable a toolbar item,\ncopy it to User Preferences and add the\n\"disabled\" key. The following example will disable the uploader button:\n{\n \"toolbar\": [\n {\n \"name\": \"uploader\",\n \"disabled\": true\n }\n ]\n}\n\nToolbar description:", 17 | "items": { 18 | "$ref": "#/definitions/toolbarItem" 19 | }, 20 | "type": "array", 21 | "default": [] 22 | } 23 | }, 24 | "additionalProperties": false, 25 | "type": "object", 26 | "definitions": { 27 | "toolbarItem": { 28 | "properties": { 29 | "name": { 30 | "title": "Unique name", 31 | "type": "string" 32 | }, 33 | "args": { 34 | "title": "Command arguments", 35 | "type": "object" 36 | }, 37 | "command": { 38 | "title": "Command id", 39 | "type": "string", 40 | "default": "" 41 | }, 42 | "disabled": { 43 | "title": "Whether the item is ignored or not", 44 | "type": "boolean", 45 | "default": false 46 | }, 47 | "icon": { 48 | "title": "Item icon id", 49 | "description": "If defined, it will override the command icon", 50 | "type": "string" 51 | }, 52 | "label": { 53 | "title": "Item label", 54 | "description": "If defined, it will override the command label", 55 | "type": "string" 56 | }, 57 | "type": { 58 | "title": "Item type", 59 | "type": "string", 60 | "enum": ["command", "spacer"] 61 | }, 62 | "rank": { 63 | "title": "Item rank", 64 | "type": "number", 65 | "minimum": 0, 66 | "default": 50 67 | } 68 | }, 69 | "required": ["name"], 70 | "additionalProperties": false, 71 | "type": "object" 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /.github/workflows/buildutils.yml: -------------------------------------------------------------------------------- 1 | name: Build Utilities 2 | 3 | on: 4 | push: 5 | branches: ['main'] 6 | pull_request: 7 | 8 | defaults: 9 | run: 10 | shell: bash -l {0} 11 | 12 | concurrency: 13 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} 14 | cancel-in-progress: true 15 | 16 | jobs: 17 | versioning: 18 | runs-on: ubuntu-latest 19 | timeout-minutes: 10 20 | steps: 21 | - name: Checkout 22 | uses: actions/checkout@v2 23 | 24 | - name: Base Setup 25 | uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 26 | 27 | - name: Install dependencies 28 | run: | 29 | python -m pip install -U "jupyterlab>=4.0.0a25,<5" ypy-websocket==0.2 hatch 30 | jlpm 31 | jlpm run build 32 | 33 | - name: Configure git identity to commit 34 | run: | 35 | git config --global user.email "you@example.com" 36 | git config --global user.name "Your Name" 37 | 38 | - name: Reset version 39 | run: | 40 | # TODO: improve this with a mock package? 41 | # This step is to ensure the workflow always starts with a final version 42 | sed -i -E 's/= VersionInfo\(.*\)/= VersionInfo\(9, 8, 7, "final", 0\)/' notebook/_version.py 43 | cat notebook/_version.py 44 | sed -i -E 's/current_version = .*/current_version = 9, 8, 7, "final", 0/' .bumpversion.cfg 45 | cat .bumpversion.cfg 46 | jlpm run lerna version 9.8.7 --no-push --force-publish --no-git-tag-version --yes 47 | git commit -am "Release 9.8.7" 48 | 49 | - name: Patch Release 50 | run: | 51 | jlpm release:patch --force 52 | 53 | - name: Minor Release 54 | run: | 55 | jlpm release:bump minor --force 56 | 57 | - name: Release Cycle 58 | run: | 59 | # beta 60 | jlpm release:bump release --force 61 | # rc 62 | jlpm release:bump release --force 63 | # final 64 | jlpm release:bump release --force 65 | 66 | - name: Major Release 67 | run: | 68 | jlpm release:bump major --force 69 | 70 | npm: 71 | runs-on: ubuntu-latest 72 | steps: 73 | - name: Checkout 74 | uses: actions/checkout@v2 75 | 76 | - name: Install Python 77 | uses: actions/setup-python@v4 78 | with: 79 | python-version: '3.9' 80 | architecture: 'x64' 81 | 82 | - name: Install dependencies 83 | run: | 84 | python -m pip install -U "jupyterlab>=4.0.0a25,<5" ypy-websocket==0.2 pip 85 | jlpm 86 | jlpm run build 87 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Is this a bug in Notebook? Open an issue. 3 | about: If you're not sure, feel free to post your question on Jupyter's Discourse channel. 4 | labels: bug 5 | --- 6 | 7 | 28 | 29 | **Describe the bug** 30 | A clear and concise description of what the bug is. 31 | 32 | **To Reproduce** 33 | Steps to reproduce the behavior: 34 | 35 | 1. Go to '...' 36 | 2. Click on '....' 37 | 3. Scroll down to '....' 38 | 4. See error 39 | 40 | **Expected behavior** 41 | A clear and concise description of what you expected to happen. 42 | 43 | **Screenshots** 44 | If applicable, add screenshots to help explain your problem. 45 | 46 | **Desktop (please complete the following information):** 47 | 48 | - OS: [e.g. iOS] 49 | - Browser [e.g. chrome, safari] 50 | - Version [e.g. 22] 51 | 52 | **Additional context** 53 | Add any other context about the problem here. 54 | -------------------------------------------------------------------------------- /packages/terminal-extension/src/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | import { 5 | IRouter, 6 | JupyterFrontEnd, 7 | JupyterFrontEndPlugin 8 | } from '@jupyterlab/application'; 9 | 10 | import { PageConfig } from '@jupyterlab/coreutils'; 11 | 12 | import { ITerminalTracker } from '@jupyterlab/terminal'; 13 | 14 | import { find } from '@lumino/algorithm'; 15 | 16 | /** 17 | * A plugin to open terminals in a new tab 18 | */ 19 | const opener: JupyterFrontEndPlugin = { 20 | id: '@jupyter-notebook/terminal-extension:opener', 21 | requires: [IRouter, ITerminalTracker], 22 | autoStart: true, 23 | activate: ( 24 | app: JupyterFrontEnd, 25 | router: IRouter, 26 | tracker: ITerminalTracker 27 | ) => { 28 | const { commands } = app; 29 | const terminalPattern = new RegExp('/terminals/(.*)'); 30 | 31 | const command = 'router:terminal'; 32 | commands.addCommand(command, { 33 | execute: (args: any) => { 34 | const parsed = args as IRouter.ILocation; 35 | const matches = parsed.path.match(terminalPattern); 36 | if (!matches) { 37 | return; 38 | } 39 | const [, name] = matches; 40 | if (!name) { 41 | return; 42 | } 43 | 44 | tracker.widgetAdded.connect((send, terminal) => { 45 | terminal.content.setOption('closeOnExit', false); 46 | }); 47 | commands.execute('terminal:open', { name }); 48 | } 49 | }); 50 | 51 | router.register({ command, pattern: terminalPattern }); 52 | } 53 | }; 54 | 55 | /** 56 | * Open terminals in a new tab. 57 | */ 58 | const redirect: JupyterFrontEndPlugin = { 59 | id: '@jupyter-notebook/terminal-extension:redirect', 60 | requires: [ITerminalTracker], 61 | autoStart: true, 62 | activate: (app: JupyterFrontEnd, tracker: ITerminalTracker) => { 63 | const baseUrl = PageConfig.getBaseUrl(); 64 | tracker.widgetAdded.connect((send, terminal) => { 65 | const widget = find(app.shell.widgets('main'), w => w.id === terminal.id); 66 | if (widget) { 67 | // bail if the terminal is already added to the main area 68 | return; 69 | } 70 | const name = terminal.content.session.name; 71 | window.open(`${baseUrl}terminals/${name}`, '_blank'); 72 | 73 | // dispose the widget since it is not used on this page 74 | terminal.dispose(); 75 | }); 76 | } 77 | }; 78 | 79 | /** 80 | * Export the plugins as default. 81 | */ 82 | const plugins: JupyterFrontEndPlugin[] = [opener, redirect]; 83 | 84 | export default plugins; 85 | -------------------------------------------------------------------------------- /ui-tests/test/smoke.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from '@playwright/test'; 2 | 3 | import { test } from './fixtures'; 4 | 5 | import { runAndAdvance } from './utils'; 6 | 7 | test.use({ autoGoto: false }); 8 | 9 | test.describe('Smoke', () => { 10 | test('Tour', async ({ page, tmpPath }) => { 11 | // Open the tree page 12 | await page.goto(`tree/${tmpPath}`); 13 | await page.click('text="Running"'); 14 | await page.click('text="Files"'); 15 | 16 | // Create a new console 17 | await page.menu.clickMenuItem('New>Console'); 18 | // Choose the kernel 19 | const [console] = await Promise.all([ 20 | page.waitForEvent('popup'), 21 | page.click('text="Select"') 22 | ]); 23 | await console.waitForLoadState(); 24 | await console.waitForSelector('.jp-CodeConsole'); 25 | 26 | // Create a new notebook 27 | const [notebook] = await Promise.all([ 28 | page.waitForEvent('popup'), 29 | page.click('text="New"'), 30 | page.click('text="Notebook"') 31 | ]); 32 | 33 | // Enter code in the first cell 34 | await notebook.fill('//textarea', 'import math'); 35 | await notebook.press('//textarea', 'Enter'); 36 | await notebook.press('//textarea', 'Enter'); 37 | await notebook.fill('//textarea', 'math.pi'); 38 | 39 | // Run the cell 40 | runAndAdvance(notebook); 41 | 42 | // Enter code in the next cell 43 | await notebook.fill( 44 | "//div[normalize-space(.)=' ​']/div[1]/textarea", 45 | 'import this' 46 | ); 47 | 48 | // Run the cell 49 | runAndAdvance(notebook); 50 | 51 | // Save the notebook 52 | // TODO: re-enable after fixing the name on save dialog? 53 | // await notebook.click('//span/*[local-name()="svg"]'); 54 | 55 | // Click on the Jupyter logo to open the tree page 56 | const [tree2] = await Promise.all([ 57 | notebook.waitForEvent('popup'), 58 | notebook.click( 59 | '//*[local-name()="svg" and normalize-space(.)=\'Jupyter\']' 60 | ) 61 | ]); 62 | 63 | // Shut down the kernels 64 | await tree2.click('text="Running"'); 65 | await tree2.click('text="Shut Down All"'); 66 | await tree2.click("//div[normalize-space(.)='Shut Down All']"); 67 | 68 | // Close the pages 69 | await tree2.close(); 70 | await notebook.close(); 71 | await console.close(); 72 | await page.close(); 73 | 74 | expect(true).toBe(true); 75 | }); 76 | 77 | test('JupyterLab', async ({ page, tmpPath }) => { 78 | // Open the tree page 79 | await page.goto(`tree/${tmpPath}`); 80 | 81 | // Open JupyterLab 82 | await page.menu.clickMenuItem('View>Open JupyterLab'); 83 | 84 | const lab = await page.waitForEvent('popup'); 85 | await lab.waitForSelector('.jp-Launcher'); 86 | await lab.close(); 87 | 88 | expect(true).toBe(true); 89 | }); 90 | }); 91 | -------------------------------------------------------------------------------- /docs/source/config_overview.rst: -------------------------------------------------------------------------------- 1 | .. _configuration-overview: 2 | 3 | Configuration Overview 4 | ====================== 5 | 6 | Beyond the default configuration settings, you can configure a rich array of 7 | options to suit your workflow. Here are areas that are commonly configured 8 | when using Jupyter Notebook: 9 | 10 | - :ref:`Jupyter's common configuration system ` 11 | - :ref:`Jupyter Server ` 12 | - :ref:`Notebook extensions ` 13 | 14 | Let's look at highlights of each area. 15 | 16 | .. _configure_common: 17 | 18 | Jupyter's Common Configuration system 19 | ------------------------------------- 20 | Jupyter applications, from the Notebook to JupyterHub to nbgrader, share a 21 | common configuration system. The process for creating a configuration file 22 | and editing settings is similar for all the Jupyter applications. 23 | 24 | - `Jupyter’s Common Configuration Approach `_ 25 | - `Common Directories and File Locations `_ 26 | - `Language kernels `_ 27 | - `traitlets `_ 28 | provide a low-level architecture for configuration. 29 | 30 | .. _configure_jupyter_server: 31 | 32 | Jupyter server 33 | --------------- 34 | 35 | The Jupyter Server runs the language kernel and communicates with the 36 | front-end Notebook client (i.e. the familiar notebook interface). 37 | 38 | - Configuring the Jupyter Server 39 | 40 | To create a ``jupyter_server_config.py`` file in the ``.jupyter`` 41 | directory, with all the defaults commented out, use the following 42 | command:: 43 | 44 | $ jupyter server --generate-config 45 | 46 | - `Running a Jupyter Server `_ 47 | - Related: `Configuring a language kernel `_ 48 | to run in the Jupyter Server enables your server to run other languages, like R or Julia. 49 | 50 | .. _configure_nbextensions: 51 | 52 | Notebook extensions 53 | ------------------- 54 | 55 | The Notebook frontend can be extending with JupyterLab extensions. 56 | 57 | See the :ref:`Frontend Extension Guide ` for more information. 58 | 59 | `Security in Jupyter notebooks: `_ 60 | Since security policies vary from organization to organization, we encourage you to 61 | consult with your security team on settings that would be best for your use 62 | cases. Our documentation offers some responsible security practices, and we 63 | recommend becoming familiar with the practices. 64 | -------------------------------------------------------------------------------- /packages/application/test/shell.spec.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | import { NotebookShell, INotebookShell } from '@jupyter-notebook/application'; 5 | 6 | import { JupyterFrontEnd } from '@jupyterlab/application'; 7 | 8 | import { toArray } from '@lumino/algorithm'; 9 | 10 | import { Widget } from '@lumino/widgets'; 11 | 12 | describe('Shell', () => { 13 | let shell: INotebookShell; 14 | 15 | beforeEach(() => { 16 | shell = new NotebookShell(); 17 | Widget.attach(shell, document.body); 18 | }); 19 | 20 | afterEach(() => { 21 | shell.dispose(); 22 | }); 23 | 24 | describe('#constructor()', () => { 25 | it('should create a LabShell instance', () => { 26 | expect(shell).toBeInstanceOf(NotebookShell); 27 | }); 28 | }); 29 | 30 | describe('#widgets()', () => { 31 | it('should add widgets to existing areas', () => { 32 | const widget = new Widget(); 33 | shell.add(widget, 'main'); 34 | const widgets = toArray(shell.widgets('main')); 35 | expect(widgets).toEqual([widget]); 36 | }); 37 | 38 | it('should throw an exception if the area does not exist', () => { 39 | const jupyterFrontEndShell = shell as JupyterFrontEnd.IShell; 40 | expect(() => { 41 | jupyterFrontEndShell.widgets('left'); 42 | }).toThrow('Invalid area: left'); 43 | }); 44 | }); 45 | 46 | describe('#currentWidget', () => { 47 | it('should be the current widget in the shell main area', () => { 48 | expect(shell.currentWidget).toBe(null); 49 | const widget = new Widget(); 50 | widget.node.tabIndex = -1; 51 | widget.id = 'foo'; 52 | expect(shell.currentWidget).toBe(null); 53 | shell.add(widget, 'main'); 54 | expect(shell.currentWidget).toBe(widget); 55 | widget.parent = null; 56 | expect(shell.currentWidget).toBe(null); 57 | }); 58 | }); 59 | 60 | describe('#add(widget, "top")', () => { 61 | it('should add a widget to the top area', () => { 62 | const widget = new Widget(); 63 | widget.id = 'foo'; 64 | shell.add(widget, 'top'); 65 | const widgets = toArray(shell.widgets('top')); 66 | expect(widgets.length).toBeGreaterThan(0); 67 | }); 68 | 69 | it('should accept options', () => { 70 | const widget = new Widget(); 71 | widget.id = 'foo'; 72 | shell.add(widget, 'top', { rank: 10 }); 73 | const widgets = toArray(shell.widgets('top')); 74 | expect(widgets.length).toBeGreaterThan(0); 75 | }); 76 | }); 77 | 78 | describe('#add(widget, "main")', () => { 79 | it('should add a widget to the main area', () => { 80 | const widget = new Widget(); 81 | widget.id = 'foo'; 82 | shell.add(widget, 'main'); 83 | const widgets = toArray(shell.widgets('main')); 84 | expect(widgets.length).toBeGreaterThan(0); 85 | }); 86 | }); 87 | }); 88 | -------------------------------------------------------------------------------- /.github/workflows/ui-tests.yml: -------------------------------------------------------------------------------- 1 | name: UI Tests 2 | 3 | on: 4 | push: 5 | branches: ["main"] 6 | pull_request: 7 | 8 | concurrency: 9 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} 10 | cancel-in-progress: true 11 | 12 | jobs: 13 | build: 14 | name: Build 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@v2 20 | 21 | - name: Build 22 | uses: ./.github/actions/build-dist 23 | 24 | ui-tests: 25 | needs: [build] 26 | runs-on: ubuntu-latest 27 | timeout-minutes: 10 28 | strategy: 29 | fail-fast: false 30 | matrix: 31 | browser: [firefox, chromium] 32 | steps: 33 | - name: Checkout 34 | uses: actions/checkout@v2 35 | 36 | - name: Base Setup 37 | uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 38 | 39 | - uses: actions/download-artifact@v2 40 | with: 41 | name: notebook-dist-${{ github.run_number }} 42 | path: ./dist 43 | 44 | - name: Install the package 45 | run: | 46 | cd dist 47 | python -m pip install -vv notebook*.whl 48 | 49 | - name: Install the test dependencies 50 | run: | 51 | cd ui-tests 52 | jlpm --frozen-lockfile 53 | jlpm playwright install 54 | 55 | - name: Start Jupyter Notebook 56 | run: | 57 | cd ui-tests 58 | jlpm start:detached 59 | 60 | - name: Wait for Jupyter Notebook 61 | uses: ifaxity/wait-on-action@v1 62 | with: 63 | resource: http-get://127.0.0.1:8888/ 64 | timeout: 360000 65 | 66 | - name: Test 67 | run: | 68 | cd ui-tests 69 | jlpm test --browser ${{ matrix.browser }} 70 | 71 | - name: Upload Playwright Test assets 72 | if: always() 73 | uses: actions/upload-artifact@v2 74 | with: 75 | name: notebook-${{ matrix.browser }}-test-assets 76 | path: | 77 | ui-tests/test-results 78 | 79 | - name: Upload Playwright Test report 80 | if: always() 81 | uses: actions/upload-artifact@v2 82 | with: 83 | name: notebook-${{ matrix.browser }}-test-report 84 | path: | 85 | ui-tests/playwright-report 86 | 87 | - name: Update snapshots 88 | if: failure() 89 | run: | 90 | cd ui-tests 91 | # remove previous snapshots from other browser 92 | jlpm rimraf "test/**/*-snapshots/*.png" 93 | # generate new snapshots 94 | jlpm run test:update --browser ${{ matrix.browser }} 95 | 96 | - name: Upload updated snapshots 97 | if: failure() 98 | uses: actions/upload-artifact@v2 99 | with: 100 | name: notebook-${{ matrix.browser }}-updated-snapshots 101 | path: ui-tests/test 102 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This project is licensed under the terms of the Modified BSD License 2 | (also known as New or Revised or 3-Clause BSD), as follows: 3 | 4 | - Copyright (c) 2001-2015, IPython Development Team 5 | - Copyright (c) 2015-, Jupyter Development Team 6 | 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions are met: 11 | 12 | Redistributions of source code must retain the above copyright notice, this 13 | list of conditions and the following disclaimer. 14 | 15 | Redistributions in binary form must reproduce the above copyright notice, this 16 | list of conditions and the following disclaimer in the documentation and/or 17 | other materials provided with the distribution. 18 | 19 | Neither the name of the Jupyter Development Team nor the names of its 20 | contributors may be used to endorse or promote products derived from this 21 | software without specific prior written permission. 22 | 23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 24 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 27 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 29 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 30 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 31 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 32 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | 34 | ## About the Jupyter Development Team 35 | 36 | The Jupyter Development Team is the set of all contributors to the Jupyter project. 37 | This includes all of the Jupyter subprojects. 38 | 39 | The core team that coordinates development on GitHub can be found here: 40 | https://github.com/jupyter/. 41 | 42 | ## Our Copyright Policy 43 | 44 | Jupyter uses a shared copyright model. Each contributor maintains copyright 45 | over their contributions to Jupyter. But, it is important to note that these 46 | contributions are typically only changes to the repositories. Thus, the Jupyter 47 | source code, in its entirety is not the copyright of any single person or 48 | institution. Instead, it is the collective copyright of the entire Jupyter 49 | Development Team. If individual contributors want to maintain a record of what 50 | changes/contributions they have specific copyright on, they should indicate 51 | their copyright in the commit message of the change, when they commit the 52 | change to one of the Jupyter repositories. 53 | 54 | With this in mind, the following banner should be used in any source code file 55 | to indicate the copyright and license terms: 56 | 57 | # Copyright (c) Jupyter Development Team. 58 | # Distributed under the terms of the Modified BSD License. 59 | -------------------------------------------------------------------------------- /ui-tests/test/notebook.spec.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | import path from 'path'; 5 | 6 | import { expect } from '@playwright/test'; 7 | 8 | import { test } from './fixtures'; 9 | 10 | import { runAndAdvance, waitForKernelReady } from './utils'; 11 | 12 | const NOTEBOOK = 'example.ipynb'; 13 | 14 | test.use({ autoGoto: false }); 15 | 16 | test.describe('Notebook', () => { 17 | test.beforeEach(async ({ page, tmpPath }) => { 18 | await page.contents.uploadFile( 19 | path.resolve(__dirname, `../../binder/${NOTEBOOK}`), 20 | `${tmpPath}/${NOTEBOOK}` 21 | ); 22 | }); 23 | 24 | test('Title should be rendered', async ({ page, tmpPath }) => { 25 | await page.goto(`notebooks/${tmpPath}/${NOTEBOOK}`); 26 | const href = await page.evaluate(() => { 27 | return document.querySelector('#jp-NotebookLogo')?.getAttribute('href'); 28 | }); 29 | expect(href).toContain('/tree'); 30 | }); 31 | 32 | test('Renaming the notebook should be possible', async ({ 33 | page, 34 | tmpPath 35 | }) => { 36 | const notebook = `${tmpPath}/${NOTEBOOK}`; 37 | await page.goto(`notebooks/${notebook}`); 38 | 39 | // Click on the title (with .ipynb extension stripped) 40 | await page.click('text="example"'); 41 | 42 | // Rename in the input dialog 43 | const newName = 'test.ipynb'; 44 | const newNameStripped = 'test'; 45 | await page.fill( 46 | `//div[normalize-space(.)='File Path${notebook}New Name']/input`, 47 | newName 48 | ); 49 | 50 | await Promise.all([ 51 | await page.click('text="Rename"'), 52 | // wait until the URL is updated 53 | await page.waitForNavigation() 54 | ]); 55 | 56 | // Check the URL contains the new name 57 | const url = page.url(); 58 | expect(url).toContain(newNameStripped); 59 | }); 60 | 61 | // TODO: rewrite with page.notebook when fixed upstream in Galata 62 | // and usable in Jupyter Notebook without active tabs 63 | test('Outputs should be scrolled automatically', async ({ 64 | page, 65 | tmpPath 66 | }) => { 67 | const notebook = 'autoscroll.ipynb'; 68 | await page.contents.uploadFile( 69 | path.resolve(__dirname, `./notebooks/${notebook}`), 70 | `${tmpPath}/${notebook}` 71 | ); 72 | await page.goto(`notebooks/${tmpPath}/${notebook}`); 73 | 74 | await waitForKernelReady(page); 75 | // run the two cells 76 | await runAndAdvance(page); 77 | await runAndAdvance(page); 78 | 79 | await page.waitForSelector('.jp-Cell-outputArea pre'); 80 | 81 | const checkCell = async (n: number): Promise => { 82 | const scrolled = await page.$eval(`.jp-Notebook-cell >> nth=${n}`, el => 83 | el.classList.contains('jp-mod-outputsScrolled') 84 | ); 85 | return scrolled; 86 | }; 87 | 88 | // check the long output area is auto scrolled 89 | expect(await checkCell(0)).toBe(true); 90 | 91 | // check the short output area is not auto scrolled 92 | expect(await checkCell(1)).toBe(false); 93 | }); 94 | }); 95 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/root", 3 | "version": "0.1.0", 4 | "private": true, 5 | "homepage": "https://github.com/jupyter/notebook", 6 | "bugs": { 7 | "url": "https://github.com/jupyter/notebook/issues" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/jupyter/notebook" 12 | }, 13 | "license": "BSD-3-Clause", 14 | "author": "Project Jupyter", 15 | "workspaces": { 16 | "packages": [ 17 | "app", 18 | "buildutils", 19 | "packages/*" 20 | ] 21 | }, 22 | "scripts": { 23 | "build": "lerna run build", 24 | "build:prod": "lerna run build:prod", 25 | "build:test": "lerna run build:test", 26 | "clean": "lerna run clean", 27 | "develop": "jupyter labextension develop . --overwrite && node ./buildutils/lib/develop.js --overwrite", 28 | "eslint": "eslint . --ext .ts,.tsx --fix", 29 | "eslint:check": "eslint . --ext .ts,.tsx", 30 | "eslint:files": "eslint --fix", 31 | "install": "lerna bootstrap", 32 | "integrity": "node buildutils/lib/ensure-repo.js", 33 | "prettier": "prettier --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"", 34 | "prettier:check": "prettier --list-different \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"", 35 | "prettier:files": "prettier --write", 36 | "release:bump": "node ./buildutils/lib/release-bump.js", 37 | "release:patch": "node ./buildutils/lib/release-patch.js", 38 | "test": "lerna run test", 39 | "update:dependency": "node ./node_modules/@jupyterlab/buildutils/lib/update-dependency.js --lerna", 40 | "watch": "run-p watch:lib watch:app", 41 | "watch:app": "lerna exec --stream --scope \"@jupyter-notebook/app\" jlpm watch", 42 | "watch:lib": "lerna exec --stream --scope @jupyter-notebook/metapackage jlpm watch" 43 | }, 44 | "devDependencies": { 45 | "@jupyterlab/buildutils": "^4.0.0-alpha.10", 46 | "@typescript-eslint/eslint-plugin": "^4.2.0", 47 | "@typescript-eslint/parser": "^4.2.0", 48 | "eslint": "^7.10.0", 49 | "eslint-config-prettier": "^6.15.0", 50 | "eslint-plugin-jest": "^24.1.3", 51 | "eslint-plugin-prettier": "^3.1.4", 52 | "eslint-plugin-react": "^7.21.5", 53 | "extra-watch-webpack-plugin": "^1.0.3", 54 | "jest": "^26.4.2", 55 | "jest-junit": "^11.1.0", 56 | "jest-raw-loader": "^1.0.1", 57 | "jest-summary-reporter": "^0.0.2", 58 | "lerna": "^5.5.0", 59 | "npm-run-all": "^4.1.5", 60 | "prettier": "^1.19.0", 61 | "rimraf": "^3.0.2", 62 | "typescript": "~4.6.3" 63 | }, 64 | "jupyter-releaser": { 65 | "hooks": { 66 | "before-build-npm": [ 67 | "jlpm clean", 68 | "jlpm build:prod" 69 | ], 70 | "before-build-python": [ 71 | "jlpm clean" 72 | ], 73 | "before-bump-version": "python -m pip install bump2version" 74 | }, 75 | "options": { 76 | "version-cmd": [ 77 | "jlpm run release:bump --force --skip-commit" 78 | ], 79 | "ignore-links": [ 80 | "https://playwright.dev/docs/test-cli/" 81 | ] 82 | }, 83 | "skip": [ 84 | "check-links", 85 | "check-manifest" 86 | ] 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /docs/source/ipython_security.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | Version: GnuPG v2.0.22 (GNU/Linux) 3 | 4 | mQINBFMx2LoBEAC9xU8JiKI1VlCJ4PT9zqhU5nChQZ06/bj1BBftiMJG07fdGVO0 5 | ibOn4TrCoRYaeRlet0UpHzxT4zDa5h3/usJaJNTSRwtWePw2o7Lik8J+F3LionRf 6 | 8Jz81WpJ+81Klg4UWKErXjBHsu/50aoQm6ZNYG4S2nwOmMVEC4nc44IAA0bb+6kW 7 | saFKKzEDsASGyuvyutdyUHiCfvvh5GOC2h9mXYvl4FaMW7K+d2UgCYERcXDNy7C1 8 | Bw+uepQ9ELKdG4ZpvonO6BNr1BWLln3wk93AQfD5qhfsYRJIyj0hJlaRLtBU3i6c 9 | xs+gQNF4mPmybpPSGuOyUr4FYC7NfoG7IUMLj+DYa6d8LcMJO+9px4IbdhQvzGtC 10 | qz5av1TX7/+gnS4L8C9i1g8xgI+MtvogngPmPY4repOlK6y3l/WtxUPkGkyYkn3s 11 | RzYyE/GJgTwuxFXzMQs91s+/iELFQq/QwmEJf+g/QYfSAuM+lVGajEDNBYVAQkxf 12 | gau4s8Gm0GzTZmINilk+7TxpXtKbFc/Yr4A/fMIHmaQ7KmJB84zKwONsQdVv7Jjj 13 | 0dpwu8EIQdHxX3k7/Q+KKubEivgoSkVwuoQTG15X9xrOsDZNwfOVQh+JKazPvJtd 14 | SNfep96r9t/8gnXv9JI95CGCQ8lNhXBUSBM3BDPTbudc4b6lFUyMXN0mKQARAQAB 15 | tCxJUHl0aG9uIFNlY3VyaXR5IFRlYW0gPHNlY3VyaXR5QGlweXRob24ub3JnPokC 16 | OAQTAQIAIgUCUzHYugIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQEwJc 17 | LcmZYkjuXg//R/t6nMNQmf9W1h52IVfUbRAVmvZ5d063hQHKV2dssxtnA2dRm/x5 18 | JZu8Wz7ZrEZpyqwRJO14sxN1/lC3v+zs9XzYXr2lBTZuKCPIBypYVGIynCuWJBQJ 19 | rWnfG4+u1RHahnjqlTWTY1C/le6v7SjAvCb6GbdA6k4ZL2EJjQlRaHDmzw3rV/+l 20 | LLx6/tYzIsotuflm/bFumyOMmpQQpJjnCkWIVjnRICZvuAn97jLgtTI0+0Rzf4Zb 21 | k2BwmHwDRqWCTTcRI9QvTl8AzjW+dNImN22TpGOBPfYj8BCZ9twrpKUbf+jNqJ1K 22 | THQzFtpdJ6SzqiFVm74xW4TKqCLkbCQ/HtVjTGMGGz/y7KTtaLpGutQ6XE8SSy6P 23 | EffSb5u+kKlQOWaH7Mc3B0yAojz6T3j5RSI8ts6pFi6pZhDg9hBfPK2dT0v/7Mkv 24 | E1Z7q2IdjZnhhtGWjDAMtDDn2NbY2wuGoa5jAWAR0WvIbEZ3kOxuLE5/ZOG1FyYm 25 | noJRliBz7038nT92EoD5g1pdzuxgXtGCpYyyjRZwaLmmi4CvA+oThKmnqWNY5lyY 26 | ricdNHDiyEXK0YafJL1oZgM86MSb0jKJMp5U11nUkUGzkroFfpGDmzBwAzEPgeiF 27 | 40+qgsKB9lqwb3G7PxvfSi3XwxfXgpm1cTyEaPSzsVzve3d1xeqb7Yq5Ag0EUzHY 28 | ugEQALQ5FtLdNoxTxMsgvrRr1ejLiUeRNUfXtN1TYttOfvAhfBVnszjtkpIW8DCB 29 | JF/bA7ETiH8OYYn/Fm6MPI5H64IHEncpzxjf57jgpXd9CA9U2OMk/P1nve5zYchP 30 | QmP2fJxeAWr0aRH0Mse5JS5nCkh8Xv4nAjsBYeLTJEVOb1gPQFXOiFcVp3gaKAzX 31 | GWOZ/mtG/uaNsabH/3TkcQQEgJefd11DWgMB7575GU+eME7c6hn3FPITA5TC5HUX 32 | azvjv/PsWGTTVAJluJ3fUDvhpbGwYOh1uV0rB68lPpqVIro18IIJhNDnccM/xqko 33 | 4fpJdokdg4L1wih+B04OEXnwgjWG8OIphR/oL/+M37VV2U7Om/GE6LGefaYccC9c 34 | tIaacRQJmZpG/8RsimFIY2wJ07z8xYBITmhMmOt0bLBv0mU0ym5KH9Dnru1m9QDO 35 | AHwcKrDgL85f9MCn+YYw0d1lYxjOXjf+moaeW3izXCJ5brM+MqVtixY6aos3YO29 36 | J7SzQ4aEDv3h/oKdDfZny21jcVPQxGDui8sqaZCi8usCcyqWsKvFHcr6vkwaufcm 37 | 3Knr2HKVotOUF5CDZybopIz1sJvY/5Dx9yfRmtivJtglrxoDKsLi1rQTlEQcFhCS 38 | ACjf7txLtv03vWHxmp4YKQFkkOlbyhIcvfPVLTvqGerdT2FHABEBAAGJAh8EGAEC 39 | AAkFAlMx2LoCGwwACgkQEwJcLcmZYkgK0BAAny0YUugpZldiHzYNf8I6p2OpiDWv 40 | ZHaguTTPg2LJSKaTd+5UHZwRFIWjcSiFu+qTGLNtZAdcr0D5f991CPvyDSLYgOwb 41 | Jm2p3GM2KxfECWzFbB/n/PjbZ5iky3+5sPlOdBR4TkfG4fcu5GwUgCkVe5u3USAk 42 | C6W5lpeaspDz39HAPRSIOFEX70+xV+6FZ17B7nixFGN+giTpGYOEdGFxtUNmHmf+ 43 | waJoPECyImDwJvmlMTeP9jfahlB6Pzaxt6TBZYHetI/JR9FU69EmA+XfCSGt5S+0 44 | Eoc330gpsSzo2VlxwRCVNrcuKmG7PsFFANok05ssFq1/Djv5rJ++3lYb88b8HSP2 45 | 3pQJPrM7cQNU8iPku9yLXkY5qsoZOH+3yAia554Dgc8WBhp6fWh58R0dIONQxbbo 46 | apNdwvlI8hKFB7TiUL6PNShE1yL+XD201iNkGAJXbLMIC1ImGLirUfU267A3Cop5 47 | hoGs179HGBcyj/sKA3uUIFdNtP+NndaP3v4iYhCitdVCvBJMm6K3tW88qkyRGzOk 48 | 4PW422oyWKwbAPeMk5PubvEFuFAIoBAFn1zecrcOg85RzRnEeXaiemmmH8GOe1Xu 49 | Kh+7h8XXyG6RPFy8tCcLOTk+miTqX+4VWy+kVqoS2cQ5IV8WsJ3S7aeIy0H89Z8n 50 | 5vmLc+Ibz+eT+rM= 51 | =XVDe 52 | -----END PGP PUBLIC KEY BLOCK----- 53 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling>=1.0", "jupyterlab>=4.0.0a25,<5", "ypy-websocket==0.2"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "notebook" 7 | description = "Jupyter Notebook - A web-based notebook environment for interactive computing" 8 | readme = "README.md" 9 | license = { file = "LICENSE" } 10 | requires-python = ">=3.7" 11 | authors = [ 12 | { name = "Jupyter Development Team", email = "jupyter@googlegroups.com" }, 13 | ] 14 | keywords = [ 15 | "Jupyter", 16 | "JupyterLab", 17 | "Notebook", 18 | ] 19 | classifiers = [ 20 | "Framework :: Jupyter", 21 | "Intended Audience :: Developers", 22 | "Intended Audience :: Science/Research", 23 | "Intended Audience :: System Administrators", 24 | "License :: OSI Approved :: BSD License", 25 | "Programming Language :: Python", 26 | "Programming Language :: Python :: 3.7", 27 | "Programming Language :: Python :: 3.8", 28 | "Programming Language :: Python :: 3.9", 29 | "Programming Language :: Python :: 3.10", 30 | ] 31 | dependencies = [ 32 | "jupyter_server>=1.16.0,<2", 33 | "jupyterlab>=4.0.0a24,<5", 34 | "jupyterlab_server>=2.13,<3", 35 | "notebook_shim>=0.1,<0.2", 36 | "tornado>=6.1.0", 37 | "ypy-websocket==0.2", 38 | ] 39 | dynamic = ["version"] 40 | 41 | [project.scripts] 42 | jupyter-notebook = "notebook.app:main" 43 | 44 | [project.urls] 45 | Documentation = "https://jupyter-notebook.readthedocs.io/" 46 | Homepage = "https://github.com/jupyter/notebook" 47 | Source = "https://github.com/jupyter/notebook" 48 | Tracker = "https://github.com/jupyter/notebook/issues" 49 | 50 | [project.optional-dependencies] 51 | test = [ 52 | "coverage", 53 | "nbval", 54 | "pytest>=6.0", 55 | "pytest-cov", 56 | "requests", 57 | "pytest-tornasync", 58 | "pytest-timeout", 59 | "pytest-console-scripts", 60 | "ipykernel", 61 | "jupyterlab_server[test]>=2.13,<3", 62 | ] 63 | dev = [ 64 | "pre-commit", 65 | "bump2version", 66 | "hatchling" 67 | ] 68 | 69 | [tool.hatch.version] 70 | path = "notebook/_version.py" 71 | source = "code" 72 | 73 | [tool.hatch.build.targets.wheel.shared-data] 74 | "notebook/labextension" = "share/jupyter/labextensions/@jupyter-notebook/lab-extension" 75 | "notebook/schemas/@jupyter-notebook" = "share/jupyter/lab/schemas/@jupyter-notebook" 76 | "jupyter-config/jupyter_server_config.d" = "etc/jupyter/jupyter_server_config.d" 77 | 78 | [tool.hatch.build.targets.sdist] 79 | artifacts = [ 80 | "notebook/labextension", 81 | "notebook/static", 82 | "notebook/schemas/@jupyter-notebook", 83 | "notebook/templates", 84 | ] 85 | include = [ 86 | "/jupyter-config", 87 | "/notebook", 88 | "/tests", 89 | "/package.json", 90 | "/install.json", 91 | "/ts*.json", 92 | "/*.md" 93 | ] 94 | 95 | [tool.hatch.build.targets.wheel] 96 | artifacts = [ 97 | "notebook/static", 98 | "notebook/templates", 99 | ] 100 | include = ["/notebook"] 101 | 102 | 103 | [tool.hatch.build.hooks.jupyter-builder] 104 | dependencies = ["hatch-jupyter-builder>=0.2"] 105 | build-function = "hatch_jupyter_builder.npm_builder" 106 | ensured-targets = [ 107 | "notebook/labextension/static/style.js", 108 | "notebook/static/bundle.js" 109 | ] 110 | install-pre-commit-hook = true 111 | 112 | [tool.hatch.build.hooks.jupyter-builder.build-kwargs] 113 | build_cmd = "build:prod" 114 | editable_build_cmd = "build" 115 | source_dir = "packages" 116 | build_dir = "notebook/static" 117 | npm = "jlpm" 118 | 119 | [tool.pytest.ini_options] 120 | addopts = "-raXs --durations 10 --color=yes --doctest-modules" 121 | testpaths = [ 122 | "tests/", 123 | ] 124 | timeout = 300 125 | filterwarnings = [ 126 | "error", 127 | "ignore:There is no current event loop:DeprecationWarning", 128 | "ignore:make_current is deprecated; start the event loop first", 129 | "ignore:clear_current is deprecated" 130 | ] 131 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches: ['main'] 6 | pull_request: 7 | 8 | permissions: 9 | contents: 10 | write 11 | 12 | concurrency: 13 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} 14 | cancel-in-progress: true 15 | 16 | env: 17 | PIP_DISABLE_PIP_VERSION_CHECK: 1 18 | 19 | defaults: 20 | run: 21 | shell: bash -e {0} 22 | 23 | jobs: 24 | build: 25 | runs-on: ubuntu-latest 26 | steps: 27 | - name: Checkout 28 | uses: actions/checkout@v2 29 | 30 | - name: Build 31 | uses: ./.github/actions/build-dist 32 | 33 | test: 34 | runs-on: ubuntu-latest 35 | timeout-minutes: 10 36 | steps: 37 | - name: Checkout 38 | uses: actions/checkout@v2 39 | 40 | - name: Base Setup 41 | uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 42 | with: 43 | python_version: "3.10" 44 | 45 | - name: Install the package 46 | run: | 47 | python -m pip install ".[dev,test]" 48 | jlpm run build:test 49 | 50 | - name: Unit tests 51 | run: | 52 | jlpm run test 53 | pytest -vv || pytest -vv --lf 54 | 55 | - name: Integration Tests 56 | run: | 57 | jupyter labextension list 2>&1 | grep -ie "@jupyter-notebook/lab-extension.*enabled.*ok" - 58 | jupyter server extension list 2>&1 | grep -ie "notebook.*enabled" - 59 | python -m jupyterlab.browser_check 60 | 61 | install: 62 | needs: [build] 63 | runs-on: ${{ matrix.os }} 64 | timeout-minutes: 10 65 | strategy: 66 | fail-fast: false 67 | matrix: 68 | os: [ubuntu-latest, macos-latest, windows-latest] 69 | python: ['3.7', '3.10'] 70 | include: 71 | - python: '3.7' 72 | dist: 'notebook*.tar.gz' 73 | - python: '3.10' 74 | dist: 'notebook*.whl' 75 | - os: windows-latest 76 | py_cmd: python 77 | - os: macos-latest 78 | py_cmd: python3 79 | - os: ubuntu-latest 80 | py_cmd: python 81 | steps: 82 | - name: Install Python 83 | uses: actions/setup-python@v4 84 | with: 85 | python-version: ${{ matrix.python }} 86 | architecture: 'x64' 87 | - uses: actions/download-artifact@v2 88 | with: 89 | name: notebook-dist-${{ github.run_number }} 90 | path: ./dist 91 | - name: Install the prerequisites 92 | run: | 93 | ${{ matrix.py_cmd }} -m pip install -U pip wheel 94 | - name: Install the package 95 | run: | 96 | cd dist 97 | ${{ matrix.py_cmd }} -m pip install -vv ${{ matrix.dist }} 98 | - name: Validate environment 99 | run: | 100 | ${{ matrix.py_cmd }} -m pip freeze 101 | ${{ matrix.py_cmd }} -m pip check 102 | - name: Validate the install 103 | run: | 104 | jupyter labextension list 105 | jupyter labextension list 2>&1 | grep -ie "@jupyter-notebook/lab-extension.*enabled.*ok" - 106 | jupyter server extension list 107 | jupyter server extension list 2>&1 | grep -ie "notebook.*enabled" - 108 | jupyter notebook --version 109 | jupyter notebook --help 110 | 111 | pre-commit: 112 | runs-on: ubuntu-latest 113 | timeout-minutes: 10 114 | steps: 115 | - uses: actions/checkout@v2 116 | - name: Base Setup 117 | uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 118 | - name: Install Jupyterlab 119 | run: pip install -e . 120 | - uses: pre-commit/action@v2.0.0 121 | with: 122 | extra_args: --all-files --hook-stage=manual 123 | - name: Help message if pre-commit fail 124 | if: ${{ failure() }} 125 | run: | 126 | echo "or you can run by hand on staged files with" 127 | echo " pre-commit run" 128 | echo "or after-the-fact on already committed files with" 129 | echo " pre-commit run --all-files --hook-stage=manual" 130 | -------------------------------------------------------------------------------- /docs/source/examples/Notebook/Connecting with the Qt Console.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Connecting to an existing IPython kernel using the Qt Console" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "## The Frontend/Kernel Model" 15 | ] 16 | }, 17 | { 18 | "cell_type": "markdown", 19 | "metadata": {}, 20 | "source": [ 21 | "The traditional IPython (`ipython`) consists of a single process that combines a terminal based UI with the process that runs the users code.\n", 22 | "\n", 23 | "While this traditional application still exists, the modern Jupyter consists of two processes:\n", 24 | "\n", 25 | "* Kernel: this is the process that runs the users code.\n", 26 | "* Frontend: this is the process that provides the user interface where the user types code and sees results.\n", 27 | "\n", 28 | "Jupyter currently has 3 frontends:\n", 29 | "\n", 30 | "* Terminal Console (`jupyter console`)\n", 31 | "* Qt Console (`jupyter qtconsole`)\n", 32 | "* Notebook (`jupyter notebook`)\n", 33 | "\n", 34 | "The Kernel and Frontend communicate over a ZeroMQ/JSON based messaging protocol, which allows multiple Frontends (even of different types) to communicate with a single Kernel. This opens the door for all sorts of interesting things, such as connecting a Console or Qt Console to a Notebook's Kernel. For example, you may want to connect a Qt console to your Notebook's Kernel and use it as a help\n", 35 | "browser, calling `??` on objects in the Qt console (whose pager is more flexible than the\n", 36 | "one in the notebook). \n", 37 | "\n", 38 | "This Notebook describes how you would connect another Frontend to an IPython Kernel that is associated with a Notebook.\n", 39 | "The commands currently given here are specific to the IPython kernel." 40 | ] 41 | }, 42 | { 43 | "cell_type": "markdown", 44 | "metadata": {}, 45 | "source": [ 46 | "## Manual connection" 47 | ] 48 | }, 49 | { 50 | "cell_type": "markdown", 51 | "metadata": {}, 52 | "source": [ 53 | "To connect another Frontend to a Kernel manually, you first need to find out the connection information for the Kernel using the `%connect_info` magic:" 54 | ] 55 | }, 56 | { 57 | "cell_type": "code", 58 | "execution_count": null, 59 | "metadata": {}, 60 | "outputs": [], 61 | "source": [ 62 | "%connect_info" 63 | ] 64 | }, 65 | { 66 | "cell_type": "markdown", 67 | "metadata": {}, 68 | "source": [ 69 | "You can see that this magic displays everything you need to connect to this Notebook's Kernel." 70 | ] 71 | }, 72 | { 73 | "cell_type": "markdown", 74 | "metadata": {}, 75 | "source": [ 76 | "## Automatic connection using a new Qt Console" 77 | ] 78 | }, 79 | { 80 | "cell_type": "markdown", 81 | "metadata": {}, 82 | "source": [ 83 | "You can also start a new Qt Console connected to your current Kernel by using the `%qtconsole` magic. This will detect the necessary connection\n", 84 | "information and start the Qt Console for you automatically." 85 | ] 86 | }, 87 | { 88 | "cell_type": "code", 89 | "execution_count": null, 90 | "metadata": {}, 91 | "outputs": [], 92 | "source": [ 93 | "a = 10" 94 | ] 95 | }, 96 | { 97 | "cell_type": "code", 98 | "execution_count": null, 99 | "metadata": {}, 100 | "outputs": [], 101 | "source": [ 102 | "%qtconsole" 103 | ] 104 | } 105 | ], 106 | "metadata": { 107 | "nbsphinx": { 108 | "execute": "never" 109 | }, 110 | "kernelspec": { 111 | "display_name": "Python 3", 112 | "language": "python", 113 | "name": "python3" 114 | }, 115 | "language_info": { 116 | "codemirror_mode": { 117 | "name": "ipython", 118 | "version": 3 119 | }, 120 | "file_extension": ".py", 121 | "mimetype": "text/x-python", 122 | "name": "python", 123 | "nbconvert_exporter": "python", 124 | "pygments_lexer": "ipython3", 125 | "version": "3.5.2" 126 | } 127 | }, 128 | "nbformat": 4, 129 | "nbformat_minor": 1 130 | } 131 | -------------------------------------------------------------------------------- /tests/conftest.py: -------------------------------------------------------------------------------- 1 | import json 2 | import os 3 | import os.path as osp 4 | import shutil 5 | from importlib.resources import path 6 | from os.path import join as pjoin 7 | 8 | import pytest 9 | 10 | from notebook.app import JupyterNotebookApp 11 | 12 | pytest_plugins = ["jupyter_server.pytest_plugin"] 13 | 14 | 15 | def mkdir(tmp_path, *parts): 16 | path = tmp_path.joinpath(*parts) 17 | if not path.exists(): 18 | path.mkdir(parents=True) 19 | return path 20 | 21 | 22 | app_settings_dir = pytest.fixture(lambda tmp_path: mkdir(tmp_path, "app_settings")) 23 | user_settings_dir = pytest.fixture(lambda tmp_path: mkdir(tmp_path, "user_settings")) 24 | schemas_dir = pytest.fixture(lambda tmp_path: mkdir(tmp_path, "schemas")) 25 | workspaces_dir = pytest.fixture(lambda tmp_path: mkdir(tmp_path, "workspaces")) 26 | labextensions_dir = pytest.fixture(lambda tmp_path: mkdir(tmp_path, "labextensions_dir")) 27 | 28 | 29 | @pytest.fixture 30 | def make_notebook_app( 31 | jp_root_dir, 32 | jp_template_dir, 33 | app_settings_dir, 34 | user_settings_dir, 35 | schemas_dir, 36 | workspaces_dir, 37 | labextensions_dir, 38 | ): 39 | def _make_notebook_app(**kwargs): 40 | 41 | return JupyterNotebookApp( 42 | static_dir=str(jp_root_dir), 43 | templates_dir=str(jp_template_dir), 44 | app_url="/", 45 | app_settings_dir=str(app_settings_dir), 46 | user_settings_dir=str(user_settings_dir), 47 | schemas_dir=str(schemas_dir), 48 | workspaces_dir=str(workspaces_dir), 49 | extra_labextensions_path=[str(labextensions_dir)], 50 | ) 51 | 52 | # Create the index files. 53 | index = jp_template_dir.joinpath("index.html") 54 | index.write_text( 55 | """ 56 | 57 | 58 | 59 | {{page_config['appName'] | e}} 60 | 61 | 62 | {# Copy so we do not modify the page_config with updates. #} 63 | {% set page_config_full = page_config.copy() %} 64 | {# Set a dummy variable - we just want the side effect of the update. #} 65 | {% set _ = page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %} 66 | 69 | 70 | 80 | 81 | 82 | """ 83 | ) 84 | 85 | # Copy the schema files. 86 | test_data = str(path("jupyterlab_server", "test_data")) 87 | src = pjoin(test_data, "schemas", "@jupyterlab") 88 | dst = pjoin(str(schemas_dir), "@jupyterlab") 89 | if os.path.exists(dst): 90 | shutil.rmtree(dst) 91 | shutil.copytree(src, dst) 92 | 93 | # Create the federated extensions 94 | for name in ["apputils-extension", "codemirror-extension"]: 95 | target_name = name + "-federated" 96 | target = pjoin(str(labextensions_dir), "@jupyterlab", target_name) 97 | src = pjoin(test_data, "schemas", "@jupyterlab", name) 98 | dst = pjoin(target, "schemas", "@jupyterlab", target_name) 99 | if osp.exists(dst): 100 | shutil.rmtree(dst) 101 | shutil.copytree(src, dst) 102 | with open(pjoin(target, "package.orig.json"), "w") as fid: 103 | data = dict(name=target_name, jupyterlab=dict(extension=True)) 104 | json.dump(data, fid) 105 | 106 | # Copy the overrides file. 107 | src = pjoin(test_data, "app-settings", "overrides.json") 108 | dst = pjoin(str(app_settings_dir), "overrides.json") 109 | if os.path.exists(dst): 110 | os.remove(dst) 111 | shutil.copyfile(src, dst) 112 | 113 | # Copy workspaces. 114 | data = pjoin(test_data, "workspaces") 115 | for item in os.listdir(data): 116 | src = pjoin(data, item) 117 | dst = pjoin(str(workspaces_dir), item) 118 | if os.path.exists(dst): 119 | os.remove(dst) 120 | shutil.copy(src, str(workspaces_dir)) 121 | 122 | return _make_notebook_app 123 | 124 | 125 | @pytest.fixture 126 | def notebookapp(jp_serverapp, make_notebook_app): 127 | app = make_notebook_app() 128 | app._link_jupyter_server_extension(jp_serverapp) 129 | app.initialize() 130 | return app 131 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Jupyter Notebook 2 | 3 | Thanks for contributing to Jupyter Notebook! 4 | 5 | Make sure to follow [Project Jupyter's Code of Conduct](https://github.com/jupyter/governance/blob/master/conduct/code_of_conduct.md) 6 | for a friendly and welcoming collaborative environment. 7 | 8 | ## Setting up a development environment 9 | 10 | Note: You will need NodeJS to build the extension package. 11 | 12 | The `jlpm` command is JupyterLab's pinned version of [yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use 13 | `yarn` or `npm` in lieu of `jlpm` below. 14 | 15 | **Note**: we recomment using `mamba` to speed the creating of the environment. 16 | 17 | ```bash 18 | # create a new environment 19 | mamba create -n notebook -c conda-forge python nodejs -y 20 | 21 | # activate the environment 22 | mamba activate notebook 23 | 24 | # Install package in development mode 25 | pip install -e ".[dev,test]" 26 | 27 | # Link the notebook extension and @jupyter-notebook schemas 28 | jlpm develop 29 | 30 | # Enable the server extension 31 | jupyter server extension enable notebook 32 | ``` 33 | 34 | `notebook` follows a monorepo structure. To build all the packages at once: 35 | 36 | ```bash 37 | jlpm build 38 | ``` 39 | 40 | There is also a `watch` script to watch for changes and rebuild the app automatically: 41 | 42 | ```bash 43 | jlpm watch 44 | ``` 45 | 46 | To make sure the `notebook` server extension is installed: 47 | 48 | ```bash 49 | $ jupyter server extension list 50 | Config dir: /home/username/.jupyter 51 | 52 | Config dir: /home/username/miniforge3/envs/notebook/etc/jupyter 53 | jupyterlab enabled 54 | - Validating jupyterlab... 55 | jupyterlab 3.0.0 OK 56 | notebook enabled 57 | - Validating notebook... 58 | notebook 7.0.0a0 OK 59 | 60 | Config dir: /usr/local/etc/jupyter 61 | ``` 62 | 63 | Then start Jupyter Notebook with: 64 | 65 | ```bash 66 | jupyter notebook 67 | ``` 68 | 69 | ## Running Tests 70 | 71 | To run the tests: 72 | 73 | ```bash 74 | jlpm run build:test 75 | jlpm run test 76 | ``` 77 | 78 | There are also end to end tests to cover higher level user interactions, located in the `ui-tests` folder. To run these tests: 79 | 80 | ```bash 81 | cd ui-tests 82 | # start a new Jupyter server in a terminal 83 | jlpm start 84 | 85 | # in a new terminal, run the tests 86 | jlpm test 87 | ``` 88 | 89 | The `test` script calls the Playwright test runner. You can pass additional arguments to `playwright` by appending parameters to the command. For example to run the test in headed mode, `jlpm test --headed`. 90 | 91 | Checkout the [Playwright Command Line Reference](https://playwright.dev/docs/test-cli/) for more information about the available command line options. 92 | 93 | Running the end to end tests in headful mode will trigger something like the following: 94 | 95 | ![playwight-headed-demo](https://user-images.githubusercontent.com/591645/141274633-ca9f9c2f-eef6-430e-9228-a35827f8133d.gif) 96 | 97 | ## Code Styling 98 | 99 | All non-python source code is formatted using [prettier](https://prettier.io) and python source code is formatted using [black](https://github.com/psf/black)s 100 | When code is modified and committed, all staged files will be 101 | automatically formatted using pre-commit git hooks (with help from 102 | [pre-commit](https://github.com/pre-commit/pre-commit). The benefit of 103 | using a code formatters like `prettier` and `black` is that it removes the topic of 104 | code style from the conversation when reviewing pull requests, thereby 105 | speeding up the review process. 106 | 107 | As long as your code is valid, 108 | the pre-commit hook should take care of how it should look. 109 | `pre-commit` and its associated hooks will automatically be installed when 110 | you run `pip install -e ".[dev,test]"` 111 | 112 | To install `pre-commit` manually, run the following: 113 | 114 | ```shell 115 | pip install pre-commit 116 | pre-commit install 117 | ``` 118 | 119 | You can invoke the pre-commit hook by hand at any time with: 120 | 121 | ```shell 122 | pre-commit run 123 | ``` 124 | 125 | which should run any autoformatting on your code 126 | and tell you about any errors it couldn't fix automatically. 127 | You may also install [black integration](https://github.com/psf/black#editor-integration) 128 | into your text editor to format code automatically. 129 | 130 | If you have already committed files before setting up the pre-commit 131 | hook with `pre-commit install`, you can fix everything up using 132 | `pre-commit run --all-files`. You need to make the fixing commit 133 | yourself after that. 134 | 135 | You may also use the prettier npm script (e.g. `npm run prettier` or 136 | `yarn prettier` or `jlpm prettier`) to format the entire code base. 137 | We recommend installing a prettier extension for your code editor and 138 | configuring it to format your code with a keyboard shortcut or 139 | automatically on save. 140 | 141 | Some of the hooks only run on CI by default, but you can invoke them by 142 | running with the `--hook-stage manual` argument. 143 | --------------------------------------------------------------------------------