├── .devcontainer ├── Dockerfile └── devcontainer.json ├── .eslintignore ├── .eslintrc.js ├── .eslintrc.json ├── .git-blame-ignore-revs ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ └── feature_request.md ├── actions │ └── build-dist │ │ └── action.yml ├── answered.yml ├── dependabot.yml ├── jupyterlab-probot.yml └── workflows │ ├── auto_author_assign.yml │ ├── binder.yml │ ├── build.yml │ ├── buildutils.yml │ ├── check-release.yml │ ├── enforce-label.yml │ ├── lock.yml │ ├── playwright-update.yml │ ├── prep-release.yml │ ├── publish-changelog.yml │ ├── publish-release.yml │ ├── ui-tests.yml │ └── upgrade-jupyterlab-dependencies.yml ├── .gitignore ├── .gitpod.yml ├── .pre-commit-config.yaml ├── .prettierignore ├── .prettierrc ├── .readthedocs.yaml ├── .yarnrc.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── RELEASE.md ├── app ├── index.template.js ├── package.json ├── publicpath.js ├── style.js ├── templates │ ├── consoles_template.html │ ├── edit_template.html │ ├── error_template.html │ ├── notebooks_template.html │ ├── terminals_template.html │ └── tree_template.html ├── webpack.config.js ├── webpack.config.watch.js └── webpack.prod.config.js ├── binder ├── environment.yml ├── example.ipynb └── postBuild ├── buildutils ├── package.json ├── src │ ├── develop.ts │ ├── ensure-repo.ts │ ├── get-latest-lab-version.ts │ ├── release-bump.ts │ ├── release-patch.ts │ ├── upgrade-lab-dependencies.ts │ └── utils.ts └── tsconfig.json ├── docs ├── Makefile ├── jsdoc_config.json ├── jsdoc_plugin.js ├── make.bat ├── resources │ ├── Info.plist.example │ ├── generate_icons.sh │ ├── icon_16x16.svg │ ├── icon_24x24.svg │ ├── icon_32x32.svg │ ├── icon_512x512.svg │ ├── ipynb.icns │ ├── ipynb.iconset │ │ ├── icon_1024x1024.png │ │ ├── icon_128x128.png │ │ ├── icon_128x128@2x.png │ │ ├── icon_16x16.png │ │ ├── icon_16x16@2x.png │ │ ├── icon_24x24.png │ │ ├── icon_24x24@2x.png │ │ ├── icon_256x256.png │ │ ├── icon_256x256@2x.png │ │ ├── icon_32x32.png │ │ ├── icon_32x32@2x.png │ │ ├── icon_48x48.png │ │ ├── icon_512x512.png │ │ ├── icon_512x512@2x.png │ │ ├── icon_64x64.png │ │ └── icon_64x64@2x.png │ └── running_code_med.png └── source │ ├── _static │ ├── .gitkeep │ ├── images │ │ ├── cell-tags-toolbar.png │ │ ├── cell-toolbar-41.png │ │ ├── command-palette-41.png │ │ ├── dashboard-sort.png │ │ ├── find-replace-41.png │ │ ├── multi-select-41.png │ │ ├── notebook-running-code.png │ │ ├── shortcut-editor.png │ │ ├── table-style-after.png │ │ └── table-style-before.png │ ├── jupyter_logo.svg │ ├── logo-rectangle-dark.svg │ ├── logo-rectangle.svg │ └── zulip-icon-square.svg │ ├── conf.py │ ├── configuration.md │ ├── configuring │ ├── config_overview.md │ ├── interface_customization.md │ └── plugins.md │ ├── contributor.md │ ├── custom_css.md │ ├── development_faq.md │ ├── examples │ ├── Notebook │ │ ├── Connecting with the Qt Console.ipynb │ │ ├── Custom Keyboard Shortcuts.ipynb │ │ ├── Importing Notebooks.ipynb │ │ ├── Notebook Basics.ipynb │ │ ├── Running Code.ipynb │ │ ├── Typesetting Equations.ipynb │ │ ├── What is the Jupyter Notebook.ipynb │ │ ├── Working With Markdown Cells.ipynb │ │ ├── examples_index.rst │ │ ├── images │ │ │ ├── command_mode.png │ │ │ ├── dashboard_files_tab.png │ │ │ ├── dashboard_files_tab_btns.png │ │ │ ├── dashboard_files_tab_new.png │ │ │ ├── dashboard_files_tab_run.png │ │ │ ├── dashboard_running_tab.png │ │ │ ├── edit_mode.png │ │ │ ├── menubar_toolbar.png │ │ │ └── nbconvert_arch.png │ │ └── nbpackage │ │ │ ├── __init__.py │ │ │ ├── mynotebook.ipynb │ │ │ └── nbs │ │ │ ├── __init__.py │ │ │ └── other.ipynb │ ├── images │ │ ├── FrontendKernel.graffle │ │ │ ├── data.plist │ │ │ └── image1.png │ │ ├── FrontendKernel.png │ │ ├── animation.m4v │ │ ├── ipython_logo.png │ │ ├── jupyter_logo.png │ │ └── python_logo.svg │ └── utils │ │ ├── list_pyfiles.ipy │ │ └── list_subdirs.ipy │ ├── extending │ ├── frontend_extensions.md │ └── index.md │ ├── index.md │ ├── ipython_security.asc │ ├── links.txt │ ├── migrate_to_notebook7.md │ ├── migrating │ ├── custom-themes.md │ ├── frontend-extensions.md │ ├── multiple-interfaces.md │ ├── server-extensions.md │ └── server-imports.md │ ├── notebook.md │ ├── notebook_7_features.md │ ├── spelling_wordlist.txt │ ├── template.tpl │ ├── troubleshooting.md │ ├── ui_components.md │ └── user-documentation.md ├── jupyter-config └── jupyter_server_config.d │ └── notebook.json ├── jupyter-notebook.desktop ├── jupyter.svg ├── jupyter_config.json ├── lerna.json ├── notebook.svg ├── notebook ├── __init__.py ├── __main__.py ├── _version.py ├── app.py └── custom │ └── custom.css ├── nx.json ├── package.json ├── packages ├── _metapackage │ ├── package.json │ ├── src │ │ └── index.ts │ └── tsconfig.json ├── application-extension │ ├── package.json │ ├── schema │ │ ├── menus.json │ │ ├── pages.json │ │ ├── shell.json │ │ ├── title.json │ │ ├── top.json │ │ └── zen.json │ ├── src │ │ └── index.ts │ ├── style │ │ ├── base.css │ │ ├── index.css │ │ └── index.js │ └── tsconfig.json ├── application │ ├── babel.config.js │ ├── jest.config.js │ ├── package.json │ ├── src │ │ ├── app.ts │ │ ├── index.ts │ │ ├── panelhandler.ts │ │ ├── pathopener.ts │ │ ├── shell.ts │ │ └── tokens.ts │ ├── style │ │ ├── base.css │ │ ├── index.css │ │ ├── index.js │ │ └── sidepanel.css │ ├── test │ │ └── shell.spec.ts │ ├── tsconfig.json │ └── tsconfig.test.json ├── console-extension │ ├── package.json │ ├── src │ │ └── index.ts │ ├── style │ │ ├── base.css │ │ ├── index.css │ │ └── index.js │ └── tsconfig.json ├── docmanager-extension │ ├── package.json │ ├── src │ │ └── index.ts │ ├── style │ │ ├── base.css │ │ ├── index.css │ │ └── index.js │ └── tsconfig.json ├── documentsearch-extension │ ├── package.json │ ├── src │ │ └── index.ts │ ├── style │ │ ├── base.css │ │ ├── index.css │ │ └── index.js │ └── tsconfig.json ├── help-extension │ ├── package.json │ ├── schema │ │ └── open.json │ ├── src │ │ └── index.tsx │ ├── style │ │ ├── base.css │ │ ├── index.css │ │ └── index.js │ └── tsconfig.json ├── lab-extension │ ├── package.json │ ├── schema │ │ ├── interface-switcher.json │ │ └── launch-tree.json │ ├── src │ │ └── index.ts │ ├── style │ │ ├── base.css │ │ ├── index.css │ │ └── index.js │ └── tsconfig.json ├── notebook-extension │ ├── package.json │ ├── schema │ │ ├── checkpoints.json │ │ ├── edit-notebook-metadata.json │ │ ├── full-width-notebook.json │ │ ├── kernel-logo.json │ │ └── scroll-output.json │ ├── src │ │ ├── index.ts │ │ └── trusted.tsx │ ├── style │ │ ├── base.css │ │ ├── index.css │ │ ├── index.js │ │ └── variables.css │ └── tsconfig.json ├── terminal-extension │ ├── package.json │ ├── src │ │ └── index.ts │ ├── style │ │ ├── base.css │ │ ├── index.css │ │ └── index.js │ └── tsconfig.json ├── tree-extension │ ├── package.json │ ├── schema │ │ ├── file-actions.json │ │ └── widget.json │ ├── src │ │ ├── fileactions.tsx │ │ └── index.ts │ ├── style │ │ ├── base.css │ │ ├── index.css │ │ └── index.js │ └── tsconfig.json ├── tree │ ├── package.json │ ├── src │ │ ├── index.ts │ │ ├── notebook-tree.ts │ │ └── token.ts │ ├── style │ │ ├── base.css │ │ ├── index.css │ │ └── index.js │ └── tsconfig.json └── ui-components │ ├── babel.config.js │ ├── jest.config.js │ ├── package.json │ ├── src │ ├── icon │ │ ├── iconimports.ts │ │ └── index.ts │ ├── index.ts │ └── svg.d.ts │ ├── style │ ├── base.css │ ├── icons │ │ └── jupyter.svg │ ├── index.css │ └── index.js │ ├── test │ └── foo.spec.ts │ ├── tsconfig.json │ └── tsconfig.test.json ├── pixi.lock ├── pyproject.toml ├── setup.py ├── tests ├── conftest.py └── test_app.py ├── tsconfig.eslint.json ├── tsconfigbase.json ├── tsconfigbase.test.json ├── ui-tests ├── package.json ├── playwright.config.ts ├── test │ ├── editor.spec.ts │ ├── filebrowser.spec.ts │ ├── fixtures.ts │ ├── general.spec.ts │ ├── general.spec.ts-snapshots │ │ ├── notebook-chromium-linux.png │ │ └── notebook-firefox-linux.png │ ├── jupyter_server_config.py │ ├── layout.spec.ts │ ├── layout.spec.ts-snapshots │ │ ├── debugger-chromium-linux.png │ │ └── debugger-firefox-linux.png │ ├── links.spec.ts │ ├── menus.spec.ts │ ├── menus.spec.ts-snapshots │ │ ├── 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-file-new-chromium-linux.png │ │ ├── opened-menu-file-new-firefox-linux.png │ │ ├── opened-menu-file-save-and-export-notebook-as-chromium-linux.png │ │ ├── opened-menu-file-save-and-export-notebook-as-firefox-linux.png │ │ ├── opened-menu-help-chromium-linux.png │ │ ├── opened-menu-help-firefox-linux.png │ │ ├── opened-menu-kernel-chromium-linux.png │ │ ├── opened-menu-kernel-firefox-linux.png │ │ ├── opened-menu-run-chromium-linux.png │ │ ├── opened-menu-run-firefox-linux.png │ │ ├── opened-menu-settings-chromium-linux.png │ │ ├── opened-menu-settings-firefox-linux.png │ │ ├── opened-menu-settings-theme-chromium-linux.png │ │ ├── opened-menu-settings-theme-firefox-linux.png │ │ ├── opened-menu-view-chromium-linux.png │ │ └── opened-menu-view-firefox-linux.png │ ├── mobile.spec.ts │ ├── mobile.spec.ts-snapshots │ │ ├── notebook-chromium-linux.png │ │ ├── notebook-firefox-linux.png │ │ ├── tree-chromium-linux.png │ │ └── tree-firefox-linux.png │ ├── notebook.spec.ts │ ├── notebook.spec.ts-snapshots │ │ ├── notebook-full-width-chromium-linux.png │ │ ├── notebook-full-width-firefox-linux.png │ │ ├── notebooktools-right-panel-chromium-linux.png │ │ ├── notebooktools-right-panel-firefox-linux.png │ │ ├── toc-left-panel-chromium-linux.png │ │ └── toc-left-panel-firefox-linux.png │ ├── notebooks │ │ ├── autoscroll.ipynb │ │ ├── empty.ipynb │ │ ├── local_links.ipynb │ │ ├── simple.ipynb │ │ └── simple_toc.ipynb │ ├── settings.spec.ts │ ├── settings.spec.ts-snapshots │ │ ├── top-hidden-chromium-linux.png │ │ ├── top-hidden-firefox-linux.png │ │ ├── top-visible-chromium-linux.png │ │ └── top-visible-firefox-linux.png │ ├── smoke.spec.ts │ ├── tree.spec.ts │ └── utils.ts ├── tsconfig.test.json └── yarn.lock └── yarn.lock /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/devcontainers/base:jammy 2 | 3 | ARG PIXI_VERSION=v0.42.1 4 | 5 | RUN curl -L -o /usr/local/bin/pixi -fsSL --compressed "https://github.com/prefix-dev/pixi/releases/download/${PIXI_VERSION}/pixi-$(uname -m)-unknown-linux-musl" \ 6 | && chmod +x /usr/local/bin/pixi \ 7 | && pixi info 8 | 9 | # set some user and workdir settings to work nicely with vscode 10 | USER vscode 11 | WORKDIR /home/vscode 12 | 13 | RUN echo 'eval "$(pixi completion -s bash)"' >> /home/vscode/.bashrc 14 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Jupyter Notebook", 3 | "build": { 4 | "dockerfile": "Dockerfile", 5 | "context": ".." 6 | }, 7 | "forwardPorts": [8888], 8 | "customizations": { 9 | "vscode": { 10 | "settings": {}, 11 | "extensions": ["ms-python.python", "charliermarsh.ruff", "GitHub.copilot"] 12 | } 13 | }, 14 | "features": { 15 | "ghcr.io/devcontainers/features/docker-in-docker:2": {} 16 | }, 17 | "mounts": [ 18 | "source=${localWorkspaceFolderBasename}-pixi,target=${containerWorkspaceFolder}/.pixi,type=volume" 19 | ], 20 | "postCreateCommand": "sudo chown vscode .pixi && pixi install && pixi run develop && pixi run pre-commit install -f" 21 | } 22 | -------------------------------------------------------------------------------- /.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 | app/index.template.js 14 | 15 | # jetbrains IDE stuff 16 | .idea/ 17 | 18 | # ms IDE stuff 19 | .history/ 20 | .vscode/ 21 | 22 | # Pixi environments 23 | .pixi 24 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # Run auto-formatters: https://github.com/jupyter/notebook/pull/6335 2 | a7717d90f128368296fe3434deba5acd6031edab 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # SCM syntax highlighting & preventing 3-way merges 2 | pixi.lock merge=binary linguist-language=YAML linguist-generated=true 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Is this a common issue? See our Docs. 4 | url: https://jupyter-notebook.readthedocs.io/en/latest/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: 🤔 Support and all other questions, including if you're not sure what to do. 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. 9 | - name: 💬 Chat with the devs 10 | url: https://jupyter.zulipchat.com/ 11 | about: Ask short questions about using Jupyter Notebook 12 | - name: 📝 Do you have a feature request that may be applied upstream? See JupyterLab. 13 | url: https://github.com/jupyterlab/jupyterlab 14 | about: We recommend that you cross-reference JupyterLab for information when requesting new features and support for Notebook 7. We won't likely accept new features for Jupyter Notebook 6.x. 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "\U0001F680 Feature Request" 3 | about: Suggest a new feature or a change 4 | labels: enhancement, status:Needs Triage 5 | --- 6 | 7 | 8 | 9 | 20 | 21 | ### Problem 22 | 23 | 28 | 29 | ### Proposed Solution 30 | 31 | 35 | 36 | ### Additional context 37 | 38 | 42 | -------------------------------------------------------------------------------- /.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 hatch 13 | 14 | - name: Build pypi distributions 15 | shell: bash 16 | run: | 17 | hatch build 18 | 19 | - name: Build npm distributions 20 | shell: bash 21 | run: | 22 | mkdir pkgs 23 | hatch run 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@v4 36 | with: 37 | name: notebook-dist-${{ github.run_number }} 38 | path: ./dist 39 | 40 | - name: Upload distributions 41 | uses: actions/upload-artifact@v4 42 | with: 43 | name: notebook-pkgs-${{ github.run_number }} 44 | path: ./pkgs 45 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: 'github-actions' 4 | directory: '/' 5 | schedule: 6 | interval: 'weekly' 7 | groups: 8 | actions: 9 | patterns: 10 | - "*" 11 | - package-ecosystem: 'pip' 12 | directory: '/' 13 | schedule: 14 | interval: 'weekly' 15 | -------------------------------------------------------------------------------- /.github/jupyterlab-probot.yml: -------------------------------------------------------------------------------- 1 | addBinderLink: false 2 | triageLabel: 'status:Needs Triage' 3 | -------------------------------------------------------------------------------- /.github/workflows/auto_author_assign.yml: -------------------------------------------------------------------------------- 1 | # https://github.com/marketplace/actions/auto-author-assign 2 | name: 'Auto Author Assign' 3 | 4 | on: 5 | pull_request_target: 6 | types: [opened, reopened] 7 | 8 | permissions: 9 | contents: read 10 | 11 | jobs: 12 | assign-author: 13 | runs-on: ubuntu-latest 14 | permissions: 15 | pull-requests: write 16 | steps: 17 | - uses: toshimaru/auto-author-assign@v2.1.1 18 | -------------------------------------------------------------------------------- /.github/workflows/binder.yml: -------------------------------------------------------------------------------- 1 | name: Binder Badge 2 | on: 3 | pull_request_target: 4 | types: [opened] 5 | 6 | permissions: 7 | contents: read 8 | 9 | jobs: 10 | binder: 11 | runs-on: ubuntu-latest 12 | permissions: 13 | pull-requests: write 14 | steps: 15 | - uses: jupyterlab/maintainer-tools/.github/actions/binder-link@v1 16 | with: 17 | github_token: ${{ secrets.github_token }} 18 | url_path: tree 19 | -------------------------------------------------------------------------------- /.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 | permissions: 17 | contents: read 18 | 19 | jobs: 20 | versioning: 21 | runs-on: ubuntu-latest 22 | timeout-minutes: 10 23 | steps: 24 | - name: Checkout 25 | uses: actions/checkout@v4 26 | 27 | - name: Base Setup 28 | uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 29 | 30 | - name: Install dependencies 31 | run: | 32 | python -m pip install -U "jupyterlab>=4.5.0a0,<4.6" hatch 33 | jlpm 34 | jlpm run build 35 | 36 | - name: Configure git identity to commit 37 | run: | 38 | git config --global user.email "you@example.com" 39 | git config --global user.name "Your Name" 40 | 41 | - name: Reset version 42 | run: | 43 | hatch version 9.8.7 44 | jlpm run lerna version 9.8.7 --no-push --force-publish --no-git-tag-version --yes 45 | git commit -am "Release 9.8.7" 46 | 47 | - name: Patch Release 48 | run: | 49 | jlpm release:patch --force 50 | 51 | - name: Minor Release 52 | run: | 53 | jlpm release:bump minor --force 54 | 55 | - name: Release Cycle 56 | run: | 57 | # beta 58 | jlpm release:bump release --force 59 | # rc 60 | jlpm release:bump release --force 61 | # final 62 | jlpm release:bump release --force 63 | 64 | - name: Major Release 65 | run: | 66 | jlpm release:bump major --force 67 | 68 | npm: 69 | runs-on: ubuntu-latest 70 | steps: 71 | - name: Checkout 72 | uses: actions/checkout@v4 73 | 74 | - name: Install Python 75 | uses: actions/setup-python@v5 76 | with: 77 | python-version: '3.10' 78 | architecture: 'x64' 79 | 80 | - name: Install dependencies 81 | run: | 82 | python -m pip install -U "jupyterlab>=4.5.0a0,<4.6" pip 83 | jlpm 84 | jlpm run build 85 | -------------------------------------------------------------------------------- /.github/workflows/check-release.yml: -------------------------------------------------------------------------------- 1 | name: Check Release 2 | on: 3 | push: 4 | branches: ['main'] 5 | pull_request: 6 | 7 | permissions: 8 | contents: read 9 | 10 | concurrency: 11 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} 12 | cancel-in-progress: true 13 | 14 | jobs: 15 | check_release: 16 | runs-on: ubuntu-latest 17 | timeout-minutes: 30 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v4 21 | - name: Base Setup 22 | uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 23 | - name: Check Release 24 | uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2 25 | with: 26 | token: ${{ secrets.GITHUB_TOKEN }} 27 | version_spec: next 28 | 29 | - name: Upload Distributions 30 | uses: actions/upload-artifact@v4 31 | with: 32 | name: notebook-jupyter-releaser-dist-${{ github.run_number }} 33 | path: .jupyter_releaser_checkout/dist 34 | -------------------------------------------------------------------------------- /.github/workflows/enforce-label.yml: -------------------------------------------------------------------------------- 1 | name: Enforce PR label 2 | 3 | permissions: 4 | contents: read 5 | 6 | on: 7 | pull_request: 8 | types: [labeled, unlabeled, opened, edited, synchronize] 9 | jobs: 10 | enforce-label: 11 | runs-on: ubuntu-latest 12 | permissions: 13 | pull-requests: write 14 | steps: 15 | - name: enforce-triage-label 16 | uses: jupyterlab/maintainer-tools/.github/actions/enforce-label@v1 17 | -------------------------------------------------------------------------------- /.github/workflows/lock.yml: -------------------------------------------------------------------------------- 1 | name: 'Lock Closed Threads' 2 | 3 | on: 4 | schedule: 5 | - cron: '0 0 * * *' 6 | 7 | permissions: 8 | contents: read 9 | 10 | jobs: 11 | lock: 12 | runs-on: ubuntu-latest 13 | permissions: 14 | issues: write 15 | pull-requests: write 16 | steps: 17 | - uses: dessant/lock-threads@v5 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 | -------------------------------------------------------------------------------- /.github/workflows/prep-release.yml: -------------------------------------------------------------------------------- 1 | name: "Step 1: Prep Release" 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | version_spec: 6 | description: "New Version Specifier" 7 | default: "next" 8 | required: false 9 | branch: 10 | description: "The branch to target" 11 | required: false 12 | post_version_spec: 13 | description: "Post Version Specifier" 14 | required: false 15 | silent: 16 | description: "Set a placeholder in the changelog and don't publish the release." 17 | required: false 18 | type: boolean 19 | since: 20 | description: "Use PRs with activity since this date or git reference" 21 | required: false 22 | since_last_stable: 23 | description: "Use PRs with activity since the last stable git tag" 24 | required: false 25 | type: boolean 26 | jobs: 27 | prep_release: 28 | runs-on: ubuntu-latest 29 | permissions: 30 | contents: write 31 | steps: 32 | - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 33 | 34 | - name: Prep Release 35 | id: prep-release 36 | uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2 37 | with: 38 | token: ${{ secrets.GITHUB_TOKEN }} 39 | version_spec: ${{ github.event.inputs.version_spec }} 40 | silent: ${{ github.event.inputs.silent }} 41 | post_version_spec: ${{ github.event.inputs.post_version_spec }} 42 | target: ${{ github.event.inputs.target }} 43 | branch: ${{ github.event.inputs.branch }} 44 | since: ${{ github.event.inputs.since }} 45 | since_last_stable: ${{ github.event.inputs.since_last_stable }} 46 | 47 | - name: "** Next Step **" 48 | run: | 49 | echo "Optional): Review Draft Release: ${{ steps.prep-release.outputs.release_url }}" 50 | -------------------------------------------------------------------------------- /.github/workflows/publish-changelog.yml: -------------------------------------------------------------------------------- 1 | name: "Publish Changelog" 2 | on: 3 | release: 4 | types: [published] 5 | 6 | workflow_dispatch: 7 | inputs: 8 | branch: 9 | description: "The branch to target" 10 | required: false 11 | 12 | jobs: 13 | publish_changelog: 14 | runs-on: ubuntu-latest 15 | environment: release 16 | steps: 17 | - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 18 | 19 | - uses: actions/create-github-app-token@v2 20 | id: app-token 21 | with: 22 | app-id: ${{ vars.APP_ID }} 23 | private-key: ${{ secrets.APP_PRIVATE_KEY }} 24 | 25 | - name: Publish changelog 26 | id: publish-changelog 27 | uses: jupyter-server/jupyter_releaser/.github/actions/publish-changelog@v2 28 | with: 29 | token: ${{ steps.app-token.outputs.token }} 30 | branch: ${{ github.event.inputs.branch }} 31 | 32 | - name: "** Next Step **" 33 | run: | 34 | echo "Merge the changelog update PR: ${{ steps.publish-changelog.outputs.pr_url }}" 35 | -------------------------------------------------------------------------------- /.github/workflows/publish-release.yml: -------------------------------------------------------------------------------- 1 | name: "Step 2: Publish Release" 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | branch: 6 | description: "The target branch" 7 | required: false 8 | release_url: 9 | description: "The URL of the draft GitHub release" 10 | required: false 11 | steps_to_skip: 12 | description: "Comma separated list of steps to skip" 13 | required: false 14 | 15 | jobs: 16 | publish_release: 17 | runs-on: ubuntu-latest 18 | environment: release 19 | permissions: 20 | id-token: write 21 | steps: 22 | - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 23 | 24 | - uses: actions/create-github-app-token@v2 25 | id: app-token 26 | with: 27 | app-id: ${{ vars.APP_ID }} 28 | private-key: ${{ secrets.APP_PRIVATE_KEY }} 29 | 30 | - name: Populate Release 31 | id: populate-release 32 | uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2 33 | with: 34 | token: ${{ steps.app-token.outputs.token }} 35 | branch: ${{ github.event.inputs.branch }} 36 | release_url: ${{ github.event.inputs.release_url }} 37 | steps_to_skip: ${{ github.event.inputs.steps_to_skip }} 38 | 39 | - name: Finalize Release 40 | id: finalize-release 41 | env: 42 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 43 | uses: jupyter-server/jupyter_releaser/.github/actions/finalize-release@v2 44 | with: 45 | token: ${{ steps.app-token.outputs.token }} 46 | release_url: ${{ steps.populate-release.outputs.release_url }} 47 | 48 | - name: "** Next Step **" 49 | if: ${{ success() }} 50 | run: | 51 | echo "Verify the final release" 52 | echo ${{ steps.finalize-release.outputs.release_url }} 53 | 54 | - name: "** Failure Message **" 55 | if: ${{ failure() }} 56 | run: | 57 | echo "Failed to Publish the Draft Release Url:" 58 | echo ${{ steps.populate-release.outputs.release_url }} 59 | -------------------------------------------------------------------------------- /.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 | permissions: 13 | contents: read 14 | 15 | jobs: 16 | build: 17 | name: Build 18 | runs-on: ubuntu-latest 19 | 20 | steps: 21 | - name: Checkout 22 | uses: actions/checkout@v4 23 | 24 | - name: Build 25 | uses: ./.github/actions/build-dist 26 | 27 | ui-tests: 28 | needs: [build] 29 | runs-on: ubuntu-latest 30 | timeout-minutes: 20 31 | strategy: 32 | fail-fast: false 33 | matrix: 34 | browser: [firefox, chromium] 35 | steps: 36 | - name: Checkout 37 | uses: actions/checkout@v4 38 | 39 | - name: Base Setup 40 | uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 41 | 42 | - uses: actions/download-artifact@v4 43 | with: 44 | name: notebook-dist-${{ github.run_number }} 45 | path: ./dist 46 | 47 | - name: Install the package 48 | run: | 49 | cd dist 50 | python -m pip install -vv notebook*.whl 51 | 52 | - name: Install the test dependencies 53 | run: | 54 | cd ui-tests 55 | jlpm 56 | jlpm playwright install 57 | 58 | - name: Test 59 | run: | 60 | cd ui-tests 61 | jlpm test --browser ${{ matrix.browser }} 62 | 63 | - name: Upload Playwright Test assets 64 | if: always() 65 | uses: actions/upload-artifact@v4 66 | with: 67 | name: notebook-${{ matrix.browser }}-test-assets 68 | path: | 69 | ui-tests/test-results 70 | 71 | - name: Upload Playwright Test report 72 | if: always() 73 | uses: actions/upload-artifact@v4 74 | with: 75 | name: notebook-${{ matrix.browser }}-test-report 76 | path: | 77 | ui-tests/playwright-report 78 | 79 | - name: Update snapshots 80 | if: failure() 81 | run: | 82 | cd ui-tests 83 | # remove previous snapshots from other browser 84 | jlpm rimraf "test/**/*-snapshots/*.png" 85 | # generate new snapshots 86 | jlpm run test:update --browser ${{ matrix.browser }} 87 | 88 | - name: Upload updated snapshots 89 | if: failure() 90 | uses: actions/upload-artifact@v4 91 | with: 92 | name: notebook-${{ matrix.browser }}-updated-snapshots 93 | path: ui-tests/test 94 | -------------------------------------------------------------------------------- /.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 | 130 | # RTC 131 | .jupyter_ystore.db 132 | 133 | # yarn >=2.x local files 134 | .yarn/* 135 | .pnp.* 136 | ui-tests/.yarn/* 137 | ui-tests/.pnp.* 138 | 139 | # keep potential upstream patches 140 | !.yarn/patches 141 | 142 | # generated html 143 | notebook/templates/*.html 144 | 145 | # pixi environments 146 | .pixi 147 | *.egg-info 148 | -------------------------------------------------------------------------------- /.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 | export TZ=UTC 23 | micromamba activate 24 | EOT 25 | source /workspace/bin/activate-env.sh 26 | micromamba install -n base -y -c conda-forge python=3.11 nodejs=18 27 | source /workspace/bin/activate-env.sh 28 | python -m pip install -e ".[dev,test]" && jlpm run build && jlpm develop 29 | gp sync-done setup 30 | command: | 31 | gp sync-done setup 32 | source /workspace/bin/activate-env.sh 33 | jupyter notebook --no-browser --ServerApp.token='' --ServerApp.allow_remote_access=True 34 | 35 | - name: auto-activate 36 | command: | 37 | gp sync-await setup 38 | source /workspace/bin/activate-env.sh 39 | jlpm watch 40 | 41 | - name: shell 42 | command: | 43 | gp sync-await setup 44 | echo "source /workspace/bin/activate-env.sh" >> ~/.bashrc 45 | source /workspace/bin/activate-env.sh 46 | 47 | - name: docs 48 | command: | 49 | gp sync-await setup 50 | sudo apt-get update 51 | sudo apt install enchant-2 -y 52 | wget https://github.com/jgm/pandoc/releases/download/2.14.2/pandoc-2.14.2-1-amd64.deb -O /tmp/pandoc.deb && sudo dpkg -i /tmp/pandoc.deb 53 | source /workspace/bin/activate-env.sh 54 | hatch run docs:build 55 | hatch run docs:serve 56 | 57 | ports: 58 | - port: 8888 59 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .mypy_cache 3 | .ruff_cache 4 | **/node_modules 5 | **/lib 6 | **/package.json 7 | **/static 8 | **/labextension 9 | build 10 | CHANGELOG.md 11 | app/index.template.js 12 | .pixi 13 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | sphinx: 3 | configuration: docs/source/conf.py 4 | build: 5 | os: ubuntu-22.04 6 | tools: 7 | python: '3.9' 8 | nodejs: '16' 9 | python: 10 | install: 11 | # install notebook itself 12 | - method: pip 13 | path: '.[docs]' 14 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | enableImmutableInstalls: false 2 | enableInlineBuilds: false 3 | enableTelemetry: false 4 | httpTimeout: 60000 5 | nodeLinker: node-modules 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | - Copyright (c) 2001-2015, IPython Development Team 4 | - Copyright (c) 2015-, Jupyter Development Team 5 | 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | 11 | 1. Redistributions of source code must retain the above copyright notice, this 12 | list of conditions and the following disclaimer. 13 | 14 | 2. Redistributions in binary form must reproduce the above copyright notice, 15 | this list of conditions and the following disclaimer in the documentation 16 | and/or other materials provided with the distribution. 17 | 18 | 3. Neither the name of the copyright holder nor the names of its 19 | contributors may be used to endorse or promote products derived from 20 | this software without specific prior written permission. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 23 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 26 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 30 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /RELEASE.md: -------------------------------------------------------------------------------- 1 | # Releasing Jupyter Notebook 2 | 3 | ## Using `jupyter_releaser` 4 | 5 | The recommended way to make a release is to use [`jupyter_releaser`](https://jupyter-releaser.readthedocs.io/en/latest/get_started/making_release_from_repo.html). 6 | 7 | ## Manual Release 8 | 9 | To create a manual release, perform the following steps: 10 | 11 | ### Set up 12 | 13 | ```bash 14 | pip install hatch twine 15 | git pull origin $(git branch --show-current) 16 | git clean -dffx 17 | ``` 18 | 19 | ### Update the version and apply the tag 20 | 21 | ```bash 22 | echo "Enter new version" 23 | read new_version 24 | hatch version ${new_version} 25 | git tag -a ${new_version} -m "Release ${new_version}" 26 | ``` 27 | 28 | ### Build the artifacts 29 | 30 | ```bash 31 | rm -rf dist 32 | hatch build 33 | ``` 34 | 35 | ### Publish the artifacts to pypi 36 | 37 | ```bash 38 | twine check dist/* 39 | twine upload dist/* 40 | ``` 41 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /app/style.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/app/style.js -------------------------------------------------------------------------------- /app/templates/consoles_template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{page_config['appName'] | e}} - Console 7 | {% block favicon %} 8 | 14 | {% endblock %} {% if custom_css %} 15 | 20 | {% endif %} 21 | 22 | 23 | {# Copy so we do not modify the page_config with updates. #} {% set 24 | page_config_full = page_config.copy() %} {# Set a dummy variable - we just 25 | want the side effect of the update. #} {% set _ = 26 | page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %} {# Sentinel value 27 | to say that we are on the tree page #} {% set _ = 28 | page_config_full.update(notebookPage='consoles') %} 29 | 30 | 33 | 34 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /app/templates/edit_template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{page_config['appName'] | e}} - Edit 7 | {% block favicon %} 8 | 14 | {% endblock %} 15 | 16 | 17 | {# Copy so we do not modify the page_config with updates. #} {% set 18 | page_config_full = page_config.copy() %} {# Set a dummy variable - we just 19 | want the side effect of the update. #} {% set _ = 20 | page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %} {# Sentinel value 21 | to say that we are on the tree page #} {% set _ = 22 | page_config_full.update(notebookPage='edit') %} 23 | 24 | 27 | 28 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /app/templates/error_template.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 | -------------------------------------------------------------------------------- /app/templates/notebooks_template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{page_config['appName'] | e}} - Notebook 7 | {% block favicon %} 8 | 14 | {% endblock %} {% if custom_css %} 15 | 20 | {% endif %} 21 | 22 | 23 | {# Copy so we do not modify the page_config with updates. #} {% set 24 | page_config_full = page_config.copy() %} {# Set a dummy variable - we just 25 | want the side effect of the update. #} {% set _ = 26 | page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %} {# Sentinel value 27 | to say that we are on the tree page #} {% set _ = 28 | page_config_full.update(notebookPage='notebooks') %} 29 | 30 | 33 | 34 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /app/templates/terminals_template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{page_config['appName'] | e}} - Terminal 7 | {% block favicon %} 8 | 14 | {% endblock %} {% if custom_css %} 15 | 20 | {% endif %} 21 | 22 | 23 | {# Copy so we do not modify the page_config with updates. #} {% set 24 | page_config_full = page_config.copy() %} {# Set a dummy variable - we just 25 | want the side effect of the update. #} {% set _ = 26 | page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %} {# Sentinel value 27 | to say that we are on the tree page #} {% set _ = 28 | page_config_full.update(notebookPage='terminals') %} 29 | 30 | 33 | 34 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /app/templates/tree_template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Home 7 | {% block favicon %} 8 | 14 | {% endblock %} {% if custom_css %} 15 | 20 | {% endif %} 21 | 22 | 23 | {# Copy so we do not modify the page_config with updates. #} {% set 24 | page_config_full = page_config.copy() %} {# Set a dummy variable - we just 25 | want the side effect of the update. #} {% set _ = 26 | page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %} {# Sentinel value 27 | to say that we are on the tree page #} {% set _ = 28 | page_config_full.update(notebookPage='tree') %} 29 | 30 | 33 | 34 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /app/webpack.prod.config.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Jupyter Development Team. 3 | * Distributed under the terms of the Modified BSD License. 4 | */ 5 | 6 | const merge = require('webpack-merge').default; 7 | const config = require('./webpack.config'); 8 | const WPPlugin = require('@jupyterlab/builder').WPPlugin; 9 | 10 | config[0] = merge(config[0], { 11 | mode: 'production', 12 | devtool: 'source-map', 13 | output: { 14 | // Add version argument when in production so the Jupyter server 15 | // allows caching of files (i.e., does not set the CacheControl header to no-cache to prevent caching static files) 16 | filename: '[name].[contenthash].js?v=[contenthash]', 17 | }, 18 | optimization: { 19 | minimize: false, 20 | }, 21 | plugins: [ 22 | new WPPlugin.JSONLicenseWebpackPlugin({ 23 | excludedPackageTest: (packageName) => 24 | packageName === '@jupyter-notebook/app', 25 | }), 26 | ], 27 | }); 28 | 29 | module.exports = config; 30 | -------------------------------------------------------------------------------- /binder/environment.yml: -------------------------------------------------------------------------------- 1 | name: notebook 2 | channels: 3 | - conda-forge 4 | dependencies: 5 | - ipywidgets=8 6 | - jupyterlab=4 7 | - jupyterlab-language-pack-fr-FR 8 | - matplotlib 9 | - numpy 10 | - nodejs=20 11 | - python >=3.10,<3.11 12 | - xeus-python 13 | -------------------------------------------------------------------------------- /binder/postBuild: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | python -m pip install -e ".[dev,test]" 5 | jlpm develop 6 | -------------------------------------------------------------------------------- /buildutils/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/buildutils", 3 | "version": "7.5.0-alpha.0", 4 | "private": true, 5 | "description": "Jupyter Notebook - Build Utilities", 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 | "directories": { 19 | "lib": "lib/" 20 | }, 21 | "files": [ 22 | "lib/*.d.ts", 23 | "lib/*.js.map", 24 | "lib/*.js" 25 | ], 26 | "scripts": { 27 | "build": "tsc", 28 | "clean": "rimraf lib && rimraf tsconfig.tsbuildinfo", 29 | "watch": "tsc -w --listEmittedFiles" 30 | }, 31 | "dependencies": { 32 | "@jupyterlab/buildutils": "~4.5.0-alpha.1", 33 | "commander": "^6.2.0", 34 | "fs-extra": "^9.1.0", 35 | "semver": "^7.6.3", 36 | "typescript": "~5.5.4" 37 | }, 38 | "devDependencies": { 39 | "@types/fs-extra": "^9.0.10", 40 | "@types/node": "^22.13.4", 41 | "@types/semver": "^7.5.8", 42 | "rimraf": "^3.0.2" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /buildutils/src/develop.ts: -------------------------------------------------------------------------------- 1 | /* ----------------------------------------------------------------------------- 2 | | Copyright (c) Jupyter Development Team. 3 | | Distributed under the terms of the Modified BSD License. 4 | |----------------------------------------------------------------------------*/ 5 | 6 | import commander from 'commander'; 7 | 8 | import fs from 'fs-extra'; 9 | 10 | import path from 'path'; 11 | 12 | import process from 'process'; 13 | 14 | import { run } from '@jupyterlab/buildutils'; 15 | 16 | commander 17 | .description('Setup the repository for develop mode') 18 | .option('--overwrite', 'Force linking the notebook schemas') 19 | .option('--source', 'The path to the notebook package') 20 | .action((options: any) => { 21 | const { overwrite } = options; 22 | const prefix = run( 23 | 'python -c "import sys; print(sys.prefix)"', 24 | { 25 | stdio: 'pipe', 26 | }, 27 | true 28 | ); 29 | const source = path.resolve(options.source ?? process.cwd()); 30 | const sourceDir = path.join( 31 | source, 32 | 'notebook', 33 | 'schemas', 34 | '@jupyter-notebook' 35 | ); 36 | const destDir = path.join( 37 | prefix, 38 | 'share', 39 | 'jupyter', 40 | 'lab', 41 | 'schemas', 42 | '@jupyter-notebook' 43 | ); 44 | if (overwrite) { 45 | try { 46 | fs.removeSync(destDir); 47 | console.log('Removed previous destination:', destDir); 48 | } catch (e) { 49 | console.info('Skip unlink', destDir); 50 | } 51 | } 52 | console.log('Symlinking:', sourceDir, destDir); 53 | fs.symlinkSync(sourceDir, destDir, 'dir'); 54 | }); 55 | 56 | commander.parse(process.argv); 57 | -------------------------------------------------------------------------------- /buildutils/src/ensure-repo.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | 3 | import * as fs from 'fs-extra'; 4 | 5 | import { writePackageData } from '@jupyterlab/buildutils'; 6 | 7 | /** 8 | * Ensure the application package resolutions. 9 | */ 10 | function ensureResolutions(): string[] { 11 | const basePath = path.resolve('.'); 12 | const corePath = path.join(basePath, 'app', 'package.json'); 13 | const corePackage = fs.readJSONSync(corePath); 14 | 15 | corePackage.resolutions = {}; 16 | 17 | const packages = Object.keys(corePackage.dependencies).concat( 18 | corePackage.jupyterlab.singletonPackages 19 | ); 20 | 21 | packages.forEach(async (name) => { 22 | let version = ''; 23 | try { 24 | const data = require(`${name}/package.json`); 25 | version = data.version; 26 | } catch { 27 | const modulePath = require.resolve(name); 28 | const parentDir = path.dirname(path.dirname(modulePath)); 29 | const data = require(path.join(parentDir, 'package.json')); 30 | version = data.version; 31 | } 32 | // Insist on a restricted version in the yarn resolution. 33 | corePackage.resolutions[name] = `~${version}`; 34 | }); 35 | 36 | // Write the package.json back to disk. 37 | if (writePackageData(corePath, corePackage)) { 38 | return ['Updated dev mode']; 39 | } 40 | return []; 41 | } 42 | 43 | if (require.main === module) { 44 | void ensureResolutions(); 45 | } 46 | -------------------------------------------------------------------------------- /buildutils/src/release-patch.ts: -------------------------------------------------------------------------------- 1 | /* ----------------------------------------------------------------------------- 2 | | Copyright (c) Jupyter Development Team. 3 | | Distributed under the terms of the Modified BSD License. 4 | |----------------------------------------------------------------------------*/ 5 | 6 | /** 7 | * Inspired by: https://github.com/jupyterlab/jupyterlab/blob/master/buildutils/src/patch-release.ts 8 | */ 9 | 10 | import * as utils from '@jupyterlab/buildutils'; 11 | 12 | import commander from 'commander'; 13 | 14 | import { getPythonVersion, postbump } from './utils'; 15 | 16 | // Specify the program signature. 17 | commander 18 | .description('Create a patch release') 19 | .option('--force', 'Force the upgrade') 20 | .option('--skip-commit', 'Whether to skip commit changes') 21 | .action((options: any) => { 22 | // Make sure we can patch release. 23 | const pyVersion = getPythonVersion(); 24 | if ( 25 | pyVersion.includes('a') || 26 | pyVersion.includes('b') || 27 | pyVersion.includes('rc') 28 | ) { 29 | throw new Error('Can only make a patch release from a final version'); 30 | } 31 | 32 | // Run pre-bump actions. 33 | utils.prebump(); 34 | 35 | // Patch the python version 36 | utils.run('hatch version patch'); 37 | 38 | // Version the changed 39 | let cmd = 40 | 'jlpm run lerna version patch --no-push --force-publish --no-git-tag-version'; 41 | if (options.force) { 42 | cmd += ' --yes'; 43 | } 44 | utils.run(cmd); 45 | 46 | // Whether to commit after bumping 47 | const commit = options.skipCommit !== true; 48 | postbump(commit); 49 | }); 50 | 51 | commander.parse(process.argv); 52 | -------------------------------------------------------------------------------- /buildutils/src/utils.ts: -------------------------------------------------------------------------------- 1 | import { run } from '@jupyterlab/buildutils'; 2 | 3 | /** 4 | * Get the current version of notebook 5 | */ 6 | export function getPythonVersion(): string { 7 | const cmd = 'hatch version'; 8 | const lines = run(cmd, { stdio: 'pipe' }, true).split('\n'); 9 | return lines[lines.length - 1]; 10 | } 11 | 12 | export function postbump(commit = true): void { 13 | // run the integrity 14 | run('jlpm integrity'); 15 | 16 | const newPyVersion = getPythonVersion(); 17 | 18 | // Commit changes. 19 | if (commit) { 20 | run(`git commit -am "Release ${newPyVersion}"`); 21 | run(`git tag ${newPyVersion}`); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /buildutils/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src", 6 | "module": "commonjs" 7 | }, 8 | "include": ["src/*"], 9 | "references": [] 10 | } 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /docs/resources/ipynb.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/resources/ipynb.icns -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_1024x1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/resources/ipynb.iconset/icon_1024x1024.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/resources/ipynb.iconset/icon_128x128.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/resources/ipynb.iconset/icon_128x128@2x.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/resources/ipynb.iconset/icon_16x16.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_16x16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/resources/ipynb.iconset/icon_16x16@2x.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_24x24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/resources/ipynb.iconset/icon_24x24.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_24x24@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/resources/ipynb.iconset/icon_24x24@2x.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/resources/ipynb.iconset/icon_256x256.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_256x256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/resources/ipynb.iconset/icon_256x256@2x.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/resources/ipynb.iconset/icon_32x32.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_32x32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/resources/ipynb.iconset/icon_32x32@2x.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/resources/ipynb.iconset/icon_48x48.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/resources/ipynb.iconset/icon_512x512.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_512x512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/resources/ipynb.iconset/icon_512x512@2x.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/resources/ipynb.iconset/icon_64x64.png -------------------------------------------------------------------------------- /docs/resources/ipynb.iconset/icon_64x64@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/resources/ipynb.iconset/icon_64x64@2x.png -------------------------------------------------------------------------------- /docs/resources/running_code_med.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/resources/running_code_med.png -------------------------------------------------------------------------------- /docs/source/_static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/_static/.gitkeep -------------------------------------------------------------------------------- /docs/source/_static/images/cell-tags-toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/_static/images/cell-tags-toolbar.png -------------------------------------------------------------------------------- /docs/source/_static/images/cell-toolbar-41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/_static/images/cell-toolbar-41.png -------------------------------------------------------------------------------- /docs/source/_static/images/command-palette-41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/_static/images/command-palette-41.png -------------------------------------------------------------------------------- /docs/source/_static/images/dashboard-sort.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/_static/images/dashboard-sort.png -------------------------------------------------------------------------------- /docs/source/_static/images/find-replace-41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/_static/images/find-replace-41.png -------------------------------------------------------------------------------- /docs/source/_static/images/multi-select-41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/_static/images/multi-select-41.png -------------------------------------------------------------------------------- /docs/source/_static/images/notebook-running-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/_static/images/notebook-running-code.png -------------------------------------------------------------------------------- /docs/source/_static/images/shortcut-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/_static/images/shortcut-editor.png -------------------------------------------------------------------------------- /docs/source/_static/images/table-style-after.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/_static/images/table-style-after.png -------------------------------------------------------------------------------- /docs/source/_static/images/table-style-before.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/_static/images/table-style-before.png -------------------------------------------------------------------------------- /docs/source/configuration.md: -------------------------------------------------------------------------------- 1 | # Configuration 2 | 3 | ```{toctree} 4 | :caption: Configuration 5 | :maxdepth: 1 6 | 7 | configuring/config_overview 8 | Security 9 | extending/index.rst 10 | ``` 11 | -------------------------------------------------------------------------------- /docs/source/configuring/interface_customization.md: -------------------------------------------------------------------------------- 1 | # Interface Customization 2 | 3 | Multiple elements in the Notebook interface can be customized via the Settings Editor. 4 | 5 | ## Layout 6 | 7 | By default some widgets are displayed in pre-defined parts of the user interface, which are often called "areas" or "regions". 8 | For example the table of contents will be displayed in the `left` area by default, while the debugger will be displayed in the `right` area. 9 | 10 | However the positioning of some of these components can also be customized via the Settings Editor. Below are a few examples of how to do this. 11 | 12 | ### Open the Markdown Preview on the left 13 | 14 | It is often useful to be able to see a rendered preview of a Markdown document while editing it. 15 | 16 | By default the Markdown Preview opens on the right side of the application. However it is also possible to open it on the left side by changing the Notebook Shell settings in the Advanced Settings Editor: 17 | 18 | ```json 19 | { 20 | "layout": { 21 | "Markdown Preview": { 22 | "area": "left" 23 | } 24 | } 25 | } 26 | ``` 27 | 28 | ![a screenshot showing the markdown preview in Notebook 7](https://github.com/jupyter/notebook/assets/591645/3faf0823-ec6f-4d5f-a66f-d6f53dc383de) 29 | 30 | ### Configuring a third-party widget 31 | 32 | Third-party extensions can also add widgets to the application shell. This is for example the case with the [Voila extension](https://github.com/voila-dashboards/voila), which adds a preview widget to visualize a notebook as a dashboard. 33 | 34 | By default in JupyterLab the Voila Preview is added to the `main` area next to the corresponding notebook. With Notebook 7 it is possible to move the Voila Preview to the `right` area by changing the Notebook Shell setting in the Advanced Settings Editor as follows: 35 | 36 | ```json 37 | { 38 | "layout": { 39 | "Voila Preview": { 40 | "area": "right" 41 | } 42 | } 43 | } 44 | ``` 45 | 46 | ![a screenshot showing the voila preview in Notebook 7](https://github.com/jupyter/notebook/assets/591645/524ade3b-05de-4d3b-8ff9-089f2d38ac77) 47 | 48 | ```{note} 49 | Refer to the [JupyterLab Layout Documentation](https://jupyterlab.readthedocs.io/en/latest/user/interface_customization.html#layout) 50 | to learn more about the default positioning of other UI elements. 51 | ``` 52 | 53 | ## Toolbars, Menu bar and Context Menu 54 | 55 | It is also possible to customize toolbars, menus and context menu entries via the Settings Editor. 56 | 57 | For example the items of the notebook toolbar can be reordered, or some menu entries can be hidden. 58 | 59 | ```{note} 60 | Refer to the [JupyterLab Documentation](https://jupyterlab.readthedocs.io/en/latest/user/interface_customization.html) 61 | to learn more about general interface customization via the settings editor. 62 | ``` 63 | -------------------------------------------------------------------------------- /docs/source/configuring/plugins.md: -------------------------------------------------------------------------------- 1 | # Managing plugins 2 | 3 | Notebook 7 uses the same extension system as JupyterLab. An extension can provide multiple plugins. 4 | 5 | ```{note} 6 | See the [JupyterLab documentation](https://jupyterlab.readthedocs.io/en/latest/user/extensions.html) to learn more about the extension system. 7 | ``` 8 | 9 | ## Examples 10 | 11 | ### Disabling the download button 12 | 13 | By default Notebook 7 provides a way to download files from the file browser. This functionality consists of a context menu entry and a main menu entry. They are provided by an application plugin that can be disabled. 14 | 15 | To disable the download entry of file browser context menus, open a terminal and run the following command: 16 | 17 | ```text 18 | jupyter labextension disable @jupyterlab/filebrowser-extension:download 19 | ``` 20 | 21 | Then restart the application and refresh the page. 22 | -------------------------------------------------------------------------------- /docs/source/contributor.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | ```{toctree} 4 | :caption: Contributor Documentation 5 | :maxdepth: 1 6 | 7 | contributing 8 | development_faq 9 | ``` 10 | -------------------------------------------------------------------------------- /docs/source/custom_css.md: -------------------------------------------------------------------------------- 1 | # Applying Custom CSS 2 | 3 | To apply custom CSS, you can add a `/custom/custom.css` file in the jupyter `config` directory. You can find the path, `~/.jupyter`, to this directory by running `jupyter --paths`. There you can create a folder named `custom` and create a `custom.css` file within the folder. 4 | 5 | ## Jupyter Styling 6 | 7 | You can use a custom CSS file to modify default Jupyter styling. 8 | 9 | ```css 10 | /* Modify Jupyter Styles */ 11 | #top-panel-wrapper, 12 | #jp-top-bar { 13 | background-color: #aecad4 !important; 14 | } 15 | 16 | #menu-panel-wrapper, 17 | #jp-MainMenu, 18 | #menu-panel { 19 | background-color: #aecad4 !important; 20 | } 21 | 22 | .jp-NotebookPanel-toolbar { 23 | background-color: #aecad4 !important; 24 | } 25 | .lm-MenuBar-content { 26 | color: #02484d; 27 | } 28 | ``` 29 | 30 | ![a screenshot custom jupyter styling](https://user-images.githubusercontent.com/12378147/245519958-17ce04e7-edc2-434e-8d93-a5c2de9fb225.png) 31 | 32 | ## Markdown 33 | 34 | Another potential application for custom CSS is styling markdown. 35 | 36 | ```css 37 | /* Headings */ 38 | h1, 39 | h2 { 40 | font-family: Impact, Charcoal, sans-serif; 41 | font-weight: bold; 42 | text-shadow: 2px 2px 4px #000000; 43 | } 44 | 45 | h1 { 46 | font-size: 52px; 47 | margin-bottom: 40px; 48 | color: #10929e; 49 | text-decoration: underline; 50 | } 51 | 52 | h2 { 53 | font-size: 448px; 54 | margin-bottom: 32px; 55 | color: #76b4be; 56 | text-transform: uppercase; 57 | } 58 | 59 | /* Block Quotes */ 60 | blockquote { 61 | font-family: Georgia, serif; 62 | font-size: 16px; 63 | color: #19085c; 64 | border-left: 8px solid #effffc; 65 | background-color: #eafcff; 66 | padding: 20px; 67 | } 68 | 69 | /* Lists */ 70 | ul, 71 | ol { 72 | font-family: Verdana, Geneva, sans-serif; 73 | font-size: 18px; 74 | color: #333333; 75 | margin-bottom: 24px; 76 | } 77 | ``` 78 | 79 | ![a screenshot of custom markdown styling](https://user-images.githubusercontent.com/12378147/245520291-968848d3-d336-4523-a046-023b15082ff8.png) 80 | -------------------------------------------------------------------------------- /docs/source/development_faq.md: -------------------------------------------------------------------------------- 1 | (development-faq)= 2 | 3 | # Developer FAQ 4 | 5 | 1. How do I install a prerelease version such as a beta or release candidate? 6 | 7 | You can install a prerelease version of the notebook using the `--pre` flag with `pip`: 8 | 9 | ```bash 10 | python -m pip install notebook --pre --upgrade 11 | ``` 12 | 13 | If you are using `conda` or `mamba`, you can install a prerelease version of the notebook using the alpha or beta label. For example, to install the latest alpha release, you can run: 14 | 15 | ```bash 16 | conda install -c conda-forge -c conda-forge/label/notebook_alpha notebook=7.0.0a18 17 | ``` 18 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/examples/Notebook/images/command_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/examples/Notebook/images/command_mode.png -------------------------------------------------------------------------------- /docs/source/examples/Notebook/images/dashboard_files_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/examples/Notebook/images/dashboard_files_tab.png -------------------------------------------------------------------------------- /docs/source/examples/Notebook/images/dashboard_files_tab_btns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/examples/Notebook/images/dashboard_files_tab_btns.png -------------------------------------------------------------------------------- /docs/source/examples/Notebook/images/dashboard_files_tab_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/examples/Notebook/images/dashboard_files_tab_new.png -------------------------------------------------------------------------------- /docs/source/examples/Notebook/images/dashboard_files_tab_run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/examples/Notebook/images/dashboard_files_tab_run.png -------------------------------------------------------------------------------- /docs/source/examples/Notebook/images/dashboard_running_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/examples/Notebook/images/dashboard_running_tab.png -------------------------------------------------------------------------------- /docs/source/examples/Notebook/images/edit_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/examples/Notebook/images/edit_mode.png -------------------------------------------------------------------------------- /docs/source/examples/Notebook/images/menubar_toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/examples/Notebook/images/menubar_toolbar.png -------------------------------------------------------------------------------- /docs/source/examples/Notebook/images/nbconvert_arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/examples/Notebook/images/nbconvert_arch.png -------------------------------------------------------------------------------- /docs/source/examples/Notebook/nbpackage/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/examples/Notebook/nbpackage/__init__.py -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /docs/source/examples/Notebook/nbpackage/nbs/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/examples/Notebook/nbpackage/nbs/__init__.py -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /docs/source/examples/images/FrontendKernel.graffle/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/examples/images/FrontendKernel.graffle/image1.png -------------------------------------------------------------------------------- /docs/source/examples/images/FrontendKernel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/examples/images/FrontendKernel.png -------------------------------------------------------------------------------- /docs/source/examples/images/animation.m4v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/examples/images/animation.m4v -------------------------------------------------------------------------------- /docs/source/examples/images/ipython_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/examples/images/ipython_logo.png -------------------------------------------------------------------------------- /docs/source/examples/images/jupyter_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/docs/source/examples/images/jupyter_logo.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /docs/source/extending/frontend_extensions.md: -------------------------------------------------------------------------------- 1 | (frontend-extensions)= 2 | 3 | # Custom front-end extensions 4 | 5 | This describes the basic steps to write a TypeScript extension for the Jupyter 6 | notebook front-end. This allows you to customize the behaviour of the various 7 | pages like the dashboard, the notebook, or the text editor. 8 | 9 | Starting with Notebook 7, front-end extensions for the notebook can be developed 10 | as prebuilt JupyterLab extensions. 11 | 12 | This means Notebook 7 is able to reuse many of the existing extensions from the JupyterLab ecosystem as is. 13 | 14 | If you would like to develop a prebuilt extension for Notebook 7, check out: 15 | 16 | - [JupyterLab Extension Tutorial](https://jupyterlab.readthedocs.io/en/latest/extension/extension_tutorial.html): A tutorial to learn how to make a simple JupyterLab extension. 17 | - The [JupyterLab Extension Examples Repository](https://github.com/jupyterlab/extension-examples): A repository containing many examples of JupyterLab extensions for performing various tasks: adding commands, adding a new widget, handling user settings, etc. 18 | -------------------------------------------------------------------------------- /docs/source/extending/index.md: -------------------------------------------------------------------------------- 1 | # Extending the Notebook 2 | 3 | ```{warning} 4 | Please note that the extension system for Notebook 7 is radically different 5 | from the one used in Notebook 6.5.x and earlier. If you are looking for 6 | information on how to extend the classic Notebook, please refer to the 7 | [documentation for NbClassic](https://nbclassic.readthedocs.io/en/latest/extending/index.html). 8 | ``` 9 | 10 | ```{note} 11 | With Notebook 7 being developed on top of JupyterLab and Jupyter Server, the 12 | frontend extension system is now based on the same extension system used by JupyterLab. 13 | 14 | Server extensions are also now based on the same system used by Jupyter Server. 15 | You will find below a link to the relevant documentations. 16 | ``` 17 | 18 | Certain subsystems of the notebook server are designed to be extended or 19 | overridden by users. These documents explain these systems, and show how to 20 | override the notebook's defaults with your own custom behavior. 21 | 22 | ```{toctree} 23 | :maxdepth: 2 24 | 25 | Extending the Jupyter Server 26 | frontend_extensions 27 | ``` 28 | -------------------------------------------------------------------------------- /docs/source/index.md: -------------------------------------------------------------------------------- 1 | # Jupyter Notebook Documentation 2 | 3 | Welcome to the **Jupyter Notebook** documentation site. **Jupyter Notebook** 4 | is a simplified notebook authoring application, and is a part of [Project 5 | Jupyter](https://docs.jupyter.org/en/latest/), a large umbrella project 6 | centered around the goal of providing tools (and [standards](https://docs.jupyter.org/en/latest/#sub-project-documentation)) 7 | for interactive computing with [computational notebooks](https://docs.jupyter.org/en/latest/#what-is-a-notebook). 8 | 9 | A [computational notebook](https://docs.jupyter.org/en/latest/#what-is-a-notebook) 10 | is a shareable document that combines computer 11 | code, plain language descriptions, data, rich visualizations like 3D models, 12 | charts, graphs and figures, and interactive controls. A notebook, along with 13 | an editor like **Jupyter Notebook**, provides a fast interactive environment for 14 | prototyping and explaining code, exploring and visualizing data, and sharing 15 | ideas with others. 16 | 17 | **Jupyter Notebook** is a sibling to other notebook authoring applications under 18 | the Project Jupyter umbrella, like [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/) 19 | and [Jupyter Desktop](https://github.com/jupyterlab/jupyterlab-desktop). 20 | Jupyter Notebook offers a lightweight, simplified experience compared to JupyterLab. 21 | 22 | Read more about how to use **Jupyter Notebook** on this site, in the [User 23 | Documentation](notebook.md). 24 | 25 | ```{image} ./_static/images/notebook-running-code.png 26 | 27 | ``` 28 | 29 | - [Installation](https://jupyter.readthedocs.io/en/latest/install.html) 30 | - [Starting the Notebook](https://jupyter.readthedocs.io/en/latest/running.html) 31 | 32 | ```{toctree} 33 | :maxdepth: 2 34 | 35 | user-documentation 36 | configuration 37 | migrate_to_notebook7 38 | contributor 39 | changelog 40 | ``` 41 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /docs/source/migrating/custom-themes.md: -------------------------------------------------------------------------------- 1 | # Custom themes in Notebook 7 2 | 3 | In Notebook 7, the way to create custom themes has changed. This means that custom themes developed for Notebook 6 or earlier will not work with Notebook 7 and upwards. 4 | 5 | This is for example the case for community contributed themes such as [jupyter-themes](https://github.com/dunovank/jupyter-themes). 6 | 7 | ## Using a custom theme 8 | 9 | Fortunately installing a custom theme for Notebook 7 is very easy. It is the same process as installing a regular extension. 10 | 11 | For example let's say you want to install the [JupyterLab Night](https://github.com/martinRenou/jupyterlab-night) theme. You can do so by running the following command: 12 | 13 | ```bash 14 | pip install jupyterlab-night 15 | ``` 16 | 17 | Then refresh the page and you should see the new theme available in the settings menu: 18 | 19 | ![a screencast showing how to install a custom theme](https://user-images.githubusercontent.com/591645/229583076-de3c0541-246f-4781-8941-fcbec2204038.gif) 20 | 21 | There are already many themes available on [PyPI](https://pypi.org/search/?q=jupyterlab-theme). 22 | 23 | You can also find other themes using the `jupyterlab-theme` topic on GitHub: https://github.com/topics/jupyterlab-theme 24 | 25 | For example: 26 | 27 | - [https://github.com/johnnybarrels/jupyterlab_onedarkpro](https://github.com/johnnybarrels/jupyterlab_onedarkpro) 28 | - [https://github.com/dunovank/jupyterlab_legos_ui](https://github.com/dunovank/jupyterlab_legos_ui) 29 | - [https://github.com/timkpaine/jupyterlab_miami_nights](https://github.com/timkpaine/jupyterlab_miami_nights) 30 | 31 | ## Creating a custom theme 32 | 33 | Creating a custom theme for Notebook 7 follows the same process as creating a custom theme for JupyterLab 4. 34 | 35 | See the {ref}`Frontend Extension Guide ` to get you started. When creating the extension, select the `Theme` option in the cookiecutter prompt. 36 | -------------------------------------------------------------------------------- /docs/source/migrating/frontend-extensions.md: -------------------------------------------------------------------------------- 1 | # Frontend Extensions in Notebook 7 2 | 3 | ```{warning} 4 | Any extension developed for Notebook \< 7 or NbClassic will not be 5 | compatible with Notebook 7 and upwards. 6 | 7 | Some extensions like nbgrader have already been ported. We invite you to 8 | check if the extensions you are using have already been ported. 9 | ``` 10 | 11 | You can check the following resources to see if your extension is available for Notebook 7: 12 | 13 | ## List of available Notebook 7 extensions 14 | 15 | To get an idea of the extensions available for Notebook 7, you can check the following resources: 16 | 17 | - [List of JupyterLab extensions][list of jupyterlab extensions] 18 | - [Awesome Jupyter][awesome jupyter] 19 | 20 | These resources are for JupyterLab, but many of them are compatible with Notebook 7 since Notebook 7 is based on JupyterLab. 21 | 22 | [list of jupyterlab extensions]: https://jupyterlab-contrib.github.io/extensions.html 23 | [awesome jupyter]: https://github.com/markusschanta/awesome-jupyter#jupyterlab-extensions 24 | 25 | ## JupyterLab equivalent extensions to the Classic Notebook 26 | 27 | The `jupyterlab-contrib` organization maintains a list of extensions to ease the transition from the Classic Notebook to Notebook 7 and / or JupyterLab. 28 | 29 | The list is available at the following URL: [Migrating from the Classic Notebook][migrate from classic] 30 | 31 | ![a screenshot showing extensions in classic and lab](https://user-images.githubusercontent.com/591645/229616855-94d34762-6666-4edd-a969-e85b285d7094.png) 32 | 33 | [migrate from classic]: https://jupyterlab-contrib.github.io/migrate_from_classical.html 34 | -------------------------------------------------------------------------------- /docs/source/migrating/server-extensions.md: -------------------------------------------------------------------------------- 1 | # Server Extensions in Notebook 7 2 | 3 | Notebook 7 is now based on Jupyter Server, which is a new server application that allows to run multiple Jupyter applications (e.g. Notebook, JupyterLab, NBClassic, etc.) on the same server. 4 | 5 | This means that Notebook 7 is able to reuse many of the existing server extensions from the Jupyter ecosystem as is. 6 | 7 | ## Migration from the Notebook Server 8 | 9 | The Jupyter Server documentation provides a [guide for migrating from the classic notebook server to Jupyter Server](https://jupyter-server.readthedocs.io/en/latest/operators/migrate-from-nbserver.html) 10 | 11 | ## Authoring Server Extensions 12 | 13 | The Jupyter Server documentation provides a [guide for authoring server extensions](https://jupyter-server.readthedocs.io/en/latest/developers/extensions.html) 14 | -------------------------------------------------------------------------------- /docs/source/migrating/server-imports.md: -------------------------------------------------------------------------------- 1 | # Server Imports in Notebook 7 2 | 3 | Notebook 7 is now based on Jupyter Server, which lets users run multiple Jupyter frontends (e.g. Notebook, JupyterLab, NBClassic, etc.) on the same server. 4 | 5 | Prior to Notebook 7, the Classic Notebook server included the server modules in the `notebook` package. This means it was possible to import the server modules from the `notebook` package, for example: 6 | 7 | ```python 8 | from notebook.auth import passwd 9 | passwd("foo") 10 | ``` 11 | 12 | Or: 13 | 14 | ```python 15 | from notebook import notebookapp 16 | notebookapp.list_running_servers() 17 | ``` 18 | 19 | In Notebook 7, these server modules are now exposed by the `jupyter_server` package. The code snippets above should be updated to: 20 | 21 | ```python 22 | from jupyter_server.auth import passwd 23 | passwd("foo") 24 | ``` 25 | 26 | And: 27 | 28 | ```python 29 | from jupyter_server import serverapp 30 | serverapp.list_running_servers() 31 | ``` 32 | 33 | These are just examples, so you may have to adjust your use of `notebook` imports based on the specific server modules you were using. 34 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /docs/source/ui_components.md: -------------------------------------------------------------------------------- 1 | # User interface components 2 | 3 | When opening bug reports or sending emails to the Jupyter mailing list, it is 4 | useful to know the names of different UI components so that other developers 5 | and users have an easier time helping you diagnose your problems. This section 6 | will familiarize you with the names of UI elements within the Notebook and the 7 | different Notebook modes. 8 | 9 | ## Notebook Dashboard 10 | 11 | When you launch `jupyter notebook` the first page that you encounter is the 12 | Notebook Dashboard. 13 | 14 | ![a screenshot showing the jupyter notebook dashboard page](https://user-images.githubusercontent.com/591645/229564680-3e9a9031-e925-4008-833c-a478b3e96c97.png) 15 | 16 | ## Notebook Editor 17 | 18 | Once you've selected a Notebook to edit, the Notebook will open in the Notebook 19 | Editor. 20 | 21 | ![a screenshot showing the default notebook interface](https://user-images.githubusercontent.com/591645/229564924-7a76bed6-924a-45ff-9ac7-6ec6d99930b7.png) 22 | 23 | ## Interactive User Interface Tour of the Notebook 24 | 25 | If you would like to learn more about the specific elements within the Notebook 26 | Editor, you can go through the user interface tour by selecting _Help_ in the 27 | menubar then selecting _User Interface Tour_. 28 | 29 | ### Edit Mode and Notebook Editor 30 | 31 | When a cell is in edit mode, the Cell Mode Indicator will change to reflect 32 | the cell's state. This state is indicated by a small pencil icon on the 33 | top right of the interface. When the cell is in command mode, there is no 34 | icon in that location. 35 | 36 | ![a screenshot showing a notebook with some cells in edit mode](https://user-images.githubusercontent.com/591645/229565074-34e61454-3329-4612-b483-7a52663c794b.png) 37 | 38 | ## File Editor 39 | 40 | Now let's say that you've chosen to open a Markdown file instead of a Notebook 41 | file whilst in the Notebook Dashboard. If so, the file will be opened in the 42 | File Editor. 43 | 44 | ![a screenshot showing the file editor](https://user-images.githubusercontent.com/591645/229565182-254eef80-edfb-4e2c-b454-1c978fd89f13.png) 45 | -------------------------------------------------------------------------------- /docs/source/user-documentation.md: -------------------------------------------------------------------------------- 1 | # Documentation 2 | 3 | Use this page to navigate to different parts of the user documentation. 4 | 5 | ```{toctree} 6 | :maxdepth: 2 7 | 8 | notebook 9 | ui_components 10 | notebook_7_features 11 | examples/Notebook/examples_index.rst 12 | custom_css 13 | configuring/plugins 14 | configuring/interface_customization 15 | troubleshooting 16 | changelog 17 | ``` 18 | -------------------------------------------------------------------------------- /jupyter-config/jupyter_server_config.d/notebook.json: -------------------------------------------------------------------------------- 1 | { 2 | "ServerApp": { 3 | "jpserver_extensions": { 4 | "notebook": true 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /jupyter-notebook.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Jupyter Notebook 3 | Comment=Run Jupyter Notebook 4 | Exec=jupyter-notebook %f 5 | Terminal=true 6 | Type=Application 7 | Icon=notebook 8 | StartupNotify=true 9 | MimeType=application/x-ipynb+json; 10 | Categories=Development;Education; 11 | Keywords=python; 12 | -------------------------------------------------------------------------------- /jupyter_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "LabApp": { "expose_app_in_browser": true }, 3 | "JupyterNotebookApp": { "expose_app_in_browser": true } 4 | } 5 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/lerna/schemas/lerna-schema.json", 3 | "version": "independent" 4 | } 5 | -------------------------------------------------------------------------------- /notebook/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import Any 4 | 5 | from ._version import __version__, version_info # noqa: F401 6 | 7 | 8 | def _jupyter_server_extension_paths() -> list[dict[str, str]]: 9 | return [{"module": "notebook"}] 10 | 11 | 12 | def _jupyter_server_extension_points() -> list[dict[str, Any]]: 13 | from .app import JupyterNotebookApp 14 | 15 | return [{"module": "notebook", "app": JupyterNotebookApp}] 16 | 17 | 18 | def _jupyter_labextension_paths() -> list[dict[str, str]]: 19 | return [{"src": "labextension", "dest": "@jupyter-notebook/lab-extension"}] 20 | -------------------------------------------------------------------------------- /notebook/__main__.py: -------------------------------------------------------------------------------- 1 | """CLI entry point for notebook.""" 2 | 3 | import sys 4 | 5 | from notebook.app import main 6 | 7 | sys.exit(main()) # type:ignore[no-untyped-call] 8 | -------------------------------------------------------------------------------- /notebook/_version.py: -------------------------------------------------------------------------------- 1 | """Version info for notebook.""" 2 | 3 | # Copyright (c) Jupyter Development Team. 4 | # Distributed under the terms of the Modified BSD License. 5 | import re 6 | from collections import namedtuple 7 | 8 | # Use "hatch version xx.yy.zz" to handle version changes 9 | __version__ = "7.5.0a0" 10 | 11 | # PEP440 version parser 12 | _version_regex = re.compile( 13 | r""" 14 | (?P\d+) 15 | \. 16 | (?P\d+) 17 | \. 18 | (?P\d+) 19 | (?P((a|b|rc|\.dev)))? 20 | (?P\d+)? 21 | """, 22 | re.VERBOSE, 23 | ) 24 | 25 | _version_fields = _version_regex.match(__version__).groupdict() # type:ignore[union-attr] 26 | 27 | VersionInfo = namedtuple("VersionInfo", ["major", "minor", "micro", "releaselevel", "serial"]) # noqa: PYI024 28 | 29 | version_info = VersionInfo( 30 | *[ 31 | field 32 | for field in ( 33 | int(_version_fields["major"]), 34 | int(_version_fields["minor"]), 35 | int(_version_fields["micro"]), 36 | _version_fields["releaselevel"] or "", 37 | _version_fields["serial"] or "", 38 | ) 39 | ] 40 | ) 41 | -------------------------------------------------------------------------------- /notebook/custom/custom.css: -------------------------------------------------------------------------------- 1 | /* 2 | Placeholder for custom user CSS 3 | 4 | mainly to be overridden in profile/static/custom/custom.css 5 | 6 | This will always be an empty file 7 | */ 8 | -------------------------------------------------------------------------------- /nx.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/nx/schemas/nx-schema.json", 3 | "tasksRunnerOptions": { 4 | "default": { 5 | "runner": "nx/tasks-runners/default", 6 | "options": { 7 | "cacheableOperations": [ 8 | "build", 9 | "build:prod", 10 | "build:lib", 11 | "build:labextension:dev", 12 | "build:labextension" 13 | ] 14 | } 15 | } 16 | }, 17 | "namedInputs": { 18 | "default": ["{projectRoot}/**/*"] 19 | }, 20 | "targetDefaults": { 21 | "build:lib": { 22 | "dependsOn": ["^build:lib"], 23 | "inputs": ["default", "^default"], 24 | "outputs": ["{projectRoot}/lib"] 25 | }, 26 | "build": { 27 | "dependsOn": ["^build"], 28 | "inputs": ["default", "^default"] 29 | }, 30 | "build:prod": { 31 | "dependsOn": ["^build:prod"], 32 | "inputs": ["default", "^default"] 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /packages/_metapackage/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/metapackage", 3 | "version": "7.5.0-alpha.0", 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": "^7.5.0-alpha.0", 24 | "@jupyter-notebook/application-extension": "^7.5.0-alpha.0", 25 | "@jupyter-notebook/console-extension": "^7.5.0-alpha.0", 26 | "@jupyter-notebook/docmanager-extension": "^7.5.0-alpha.0", 27 | "@jupyter-notebook/documentsearch-extension": "^7.5.0-alpha.0", 28 | "@jupyter-notebook/help-extension": "^7.5.0-alpha.0", 29 | "@jupyter-notebook/lab-extension": "^7.5.0-alpha.0", 30 | "@jupyter-notebook/notebook-extension": "^7.5.0-alpha.0", 31 | "@jupyter-notebook/terminal-extension": "^7.5.0-alpha.0", 32 | "@jupyter-notebook/tree": "^7.5.0-alpha.0", 33 | "@jupyter-notebook/tree-extension": "^7.5.0-alpha.0", 34 | "@jupyter-notebook/ui-components": "^7.5.0-alpha.0" 35 | }, 36 | "devDependencies": { 37 | "typescript": "~5.5.4" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /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/_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" }, 19 | { "path": "../tree-extension" }, 20 | { "path": "../ui-components" } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/application-extension/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/application-extension", 3 | "version": "7.5.0-alpha.0", 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 | "watch": "tsc -b --watch" 39 | }, 40 | "dependencies": { 41 | "@jupyter-notebook/application": "^7.5.0-alpha.0", 42 | "@jupyter-notebook/ui-components": "^7.5.0-alpha.0", 43 | "@jupyterlab/application": "~4.5.0-alpha.1", 44 | "@jupyterlab/apputils": "~4.6.0-alpha.1", 45 | "@jupyterlab/codeeditor": "~4.5.0-alpha.1", 46 | "@jupyterlab/console": "~4.5.0-alpha.1", 47 | "@jupyterlab/coreutils": "~6.5.0-alpha.1", 48 | "@jupyterlab/docmanager": "~4.5.0-alpha.1", 49 | "@jupyterlab/docregistry": "~4.5.0-alpha.1", 50 | "@jupyterlab/mainmenu": "~4.5.0-alpha.1", 51 | "@jupyterlab/rendermime": "~4.5.0-alpha.1", 52 | "@jupyterlab/settingregistry": "~4.5.0-alpha.1", 53 | "@jupyterlab/translation": "~4.5.0-alpha.1", 54 | "@lumino/coreutils": "^2.2.1", 55 | "@lumino/disposable": "^2.1.4", 56 | "@lumino/widgets": "^2.7.1" 57 | }, 58 | "devDependencies": { 59 | "rimraf": "^3.0.2", 60 | "typescript": "~5.5.4" 61 | }, 62 | "publishConfig": { 63 | "access": "public" 64 | }, 65 | "jupyterlab": { 66 | "extension": true, 67 | "schemaDir": "schema" 68 | }, 69 | "styleModule": "style/index.js" 70 | } 71 | -------------------------------------------------------------------------------- /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": "application:duplicate", 15 | "rank": 4.8 16 | }, 17 | { 18 | "command": "notebook:trust", 19 | "rank": 20 20 | }, 21 | { 22 | "type": "separator", 23 | "rank": 30 24 | }, 25 | { 26 | "command": "filemenu:close-and-cleanup", 27 | "rank": 40 28 | }, 29 | { 30 | "command": "application:close", 31 | "disabled": true 32 | } 33 | ] 34 | }, 35 | { 36 | "id": "jp-mainmenu-view", 37 | "items": [ 38 | { 39 | "type": "submenu", 40 | "disabled": true, 41 | "submenu": { 42 | "id": "jp-mainmenu-view-appearance" 43 | } 44 | } 45 | ] 46 | }, 47 | { 48 | "id": "jp-mainmenu-run", 49 | "items": [ 50 | { 51 | "type": "separator", 52 | "rank": 1000 53 | }, 54 | { 55 | "type": "submenu", 56 | "rank": 1010, 57 | "submenu": { 58 | "id": "jp-runmenu-change-cell-type", 59 | "label": "Cell Type", 60 | "items": [ 61 | { 62 | "command": "notebook:change-cell-to-code", 63 | "rank": 0 64 | }, 65 | { 66 | "command": "notebook:change-cell-to-markdown", 67 | "rank": 0 68 | }, 69 | { 70 | "command": "notebook:change-cell-to-raw", 71 | "rank": 0 72 | } 73 | ] 74 | } 75 | } 76 | ] 77 | } 78 | ] 79 | }, 80 | "properties": {}, 81 | "additionalProperties": false, 82 | "type": "object" 83 | } 84 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /packages/application-extension/schema/shell.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema", 3 | "title": "Notebook Shell", 4 | "description": "Notebook Shell layout settings.", 5 | "properties": { 6 | "layout": { 7 | "$ref": "#/definitions/layout", 8 | "type": "object", 9 | "title": "Customize shell widget positioning", 10 | "description": "Overrides default widget position in the application layout", 11 | "default": { 12 | "Markdown Preview": { "area": "right" }, 13 | "Plugins": { "area": "left" } 14 | } 15 | } 16 | }, 17 | "additionalProperties": false, 18 | "type": "object", 19 | "definitions": { 20 | "layout": { 21 | "type": "object", 22 | "properties": { 23 | "[\\w-]+": { 24 | "type": "object", 25 | "properties": { 26 | "area": { 27 | "enum": ["left", "right"] 28 | } 29 | }, 30 | "additionalProperties": false 31 | } 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /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/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": "string", 22 | "enum": ["yes", "no", "automatic"], 23 | "title": "Top Bar Visibility", 24 | "description": "Whether to show the top bar or not, yes for always showing, no for always not showing, automatic for adjusting to screen size", 25 | "default": "automatic" 26 | } 27 | }, 28 | "additionalProperties": false, 29 | "type": "object" 30 | } 31 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | 20 | #jp-UserMenu { 21 | flex: 0 0 auto; 22 | display: flex; 23 | text-align: center; 24 | margin-top: 8px; 25 | } 26 | 27 | .jp-MimeDocument .jp-RenderedJSON { 28 | background: var(--jp-layout-color0); 29 | } 30 | 31 | /* Hide the stub toolbar that appears above terminals and documents */ 32 | 33 | .jp-MainAreaWidget > .jp-Toolbar-micro { 34 | display: none; 35 | } 36 | 37 | #jp-NotebookLogo { 38 | /* bring logo to the front so it is selectable by tab*/ 39 | z-index: 10; 40 | } 41 | 42 | /* Hide the notification status item */ 43 | .jp-Notification-Status { 44 | display: none; 45 | } 46 | -------------------------------------------------------------------------------- /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-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/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 | "path": "../ui-components" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/application/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@jupyterlab/testutils/lib/babel.config'); 2 | -------------------------------------------------------------------------------- /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 | }; 17 | 18 | Object.keys(local).forEach((option) => { 19 | upstream[option] = local[option]; 20 | }); 21 | 22 | module.exports = upstream; 23 | -------------------------------------------------------------------------------- /packages/application/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/application", 3 | "version": "7.5.0-alpha.0", 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 | "test": "jest", 39 | "test:cov": "jest --collect-coverage", 40 | "test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand", 41 | "test:debug:watch": "node --inspect-brk node_modules/.bin/jest --runInBand --watch", 42 | "watch": "tsc -b --watch" 43 | }, 44 | "dependencies": { 45 | "@jupyterlab/application": "~4.5.0-alpha.1", 46 | "@jupyterlab/coreutils": "~6.5.0-alpha.1", 47 | "@jupyterlab/docregistry": "~4.5.0-alpha.1", 48 | "@jupyterlab/rendermime-interfaces": "~3.13.0-alpha.1", 49 | "@jupyterlab/ui-components": "~4.5.0-alpha.1", 50 | "@lumino/algorithm": "^2.0.3", 51 | "@lumino/coreutils": "^2.2.1", 52 | "@lumino/messaging": "^2.0.3", 53 | "@lumino/polling": "^2.1.4", 54 | "@lumino/signaling": "^2.1.4", 55 | "@lumino/widgets": "^2.7.1" 56 | }, 57 | "devDependencies": { 58 | "@babel/core": "^7.11.6", 59 | "@babel/preset-env": "^7.12.1", 60 | "@jupyterlab/testutils": "~4.3.2", 61 | "@types/jest": "^29.2.5", 62 | "jest": "^29.3.1", 63 | "rimraf": "^3.0.2", 64 | "ts-jest": "^29.0.3", 65 | "typescript": "~5.5.4" 66 | }, 67 | "publishConfig": { 68 | "access": "public" 69 | }, 70 | "jupyterlab": { 71 | "coreDependency": true 72 | }, 73 | "styleModule": "style/index.js" 74 | } 75 | -------------------------------------------------------------------------------- /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 | export * from './panelhandler'; 7 | export * from './pathopener'; 8 | export * from './tokens'; 9 | -------------------------------------------------------------------------------- /packages/application/src/pathopener.ts: -------------------------------------------------------------------------------- 1 | // Copyright (c) Jupyter Development Team. 2 | // Distributed under the terms of the Modified BSD License. 3 | 4 | import { URLExt } from '@jupyterlab/coreutils'; 5 | 6 | import { INotebookPathOpener } from './tokens'; 7 | 8 | /** 9 | * A class to open paths in new browser tabs in the Notebook application. 10 | */ 11 | class DefaultNotebookPathOpener implements INotebookPathOpener { 12 | /** 13 | * Open a path in a new browser tab. 14 | */ 15 | open(options: INotebookPathOpener.IOpenOptions): WindowProxy | null { 16 | const { prefix, path, searchParams, target, features } = options; 17 | const url = new URL( 18 | URLExt.join(prefix, path ?? ''), 19 | window.location.origin 20 | ); 21 | if (searchParams) { 22 | url.search = searchParams.toString(); 23 | } 24 | return window.open(url, target, features); 25 | } 26 | } 27 | 28 | export const defaultNotebookPathOpener = new DefaultNotebookPathOpener(); 29 | -------------------------------------------------------------------------------- /packages/application/src/tokens.ts: -------------------------------------------------------------------------------- 1 | import { Token } from '@lumino/coreutils'; 2 | 3 | /** 4 | * The INotebookPathOpener interface. 5 | */ 6 | export interface INotebookPathOpener { 7 | /** 8 | * Open a path in the application. 9 | * 10 | * @param options - The options used to open the path. 11 | */ 12 | open: (options: INotebookPathOpener.IOpenOptions) => WindowProxy | null; 13 | } 14 | 15 | export namespace INotebookPathOpener { 16 | /** 17 | * The options used to open a path in the application. 18 | */ 19 | export interface IOpenOptions { 20 | /** 21 | * The URL prefix, which should include the base URL 22 | */ 23 | prefix: string; 24 | 25 | /** 26 | * The path to open in the application, e.g `setup.py`, or `notebooks/example.ipynb` 27 | */ 28 | path?: string; 29 | 30 | /** 31 | * The extra search params to use in the URL. 32 | */ 33 | searchParams?: URLSearchParams; 34 | 35 | /** 36 | * Name of the browsing context the resource is being loaded into. 37 | * See https://developer.mozilla.org/en-US/docs/Web/API/Window/open for more details. 38 | */ 39 | target?: string; 40 | 41 | /** 42 | * 43 | * See https://developer.mozilla.org/en-US/docs/Web/API/Window/open for more details. 44 | */ 45 | features?: string; 46 | } 47 | } 48 | 49 | /** 50 | * The INotebookPathOpener token. 51 | * The main purpose of this token is to allow other extensions or downstream applications 52 | * to override the default behavior of opening a notebook in a new tab. 53 | * It also allows passing the path as a URL search parameter, or other options to the window.open call. 54 | */ 55 | export const INotebookPathOpener = new Token( 56 | '@jupyter-notebook/application:INotebookPathOpener' 57 | ); 58 | -------------------------------------------------------------------------------- /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 | @import url('./sidepanel.css'); 12 | -------------------------------------------------------------------------------- /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 | import './sidepanel.css'; 12 | -------------------------------------------------------------------------------- /packages/application/style/sidepanel.css: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | | Copyright (c) Jupyter Development Team. 3 | | Distributed under the terms of the Modified BSD License. 4 | | 5 | | Adapted from JupyterLab's packages/application/style/sidepanel.css. 6 | |----------------------------------------------------------------------------*/ 7 | 8 | /*----------------------------------------------------------------------------- 9 | | Variables 10 | |----------------------------------------------------------------------------*/ 11 | 12 | :root { 13 | --jp-private-sidebar-tab-width: 32px; 14 | } 15 | 16 | /*----------------------------------------------------------------------------- 17 | | SideBar 18 | |----------------------------------------------------------------------------*/ 19 | 20 | /* Stack panels */ 21 | 22 | #jp-right-stack, 23 | #jp-left-stack { 24 | display: flex; 25 | flex-direction: column; 26 | min-width: var(--jp-sidebar-min-width); 27 | } 28 | 29 | #jp-left-stack .jp-SidePanel-collapse, 30 | #jp-right-stack .jp-SidePanel-collapse { 31 | display: flex; 32 | flex: 0 0 auto; 33 | min-height: 0; 34 | padding: 0; 35 | } 36 | 37 | #jp-left-stack .jp-SidePanel-collapse { 38 | justify-content: right; 39 | } 40 | 41 | #jp-right-stack .jp-SidePanel-collapse { 42 | justify-content: left; 43 | } 44 | 45 | #jp-left-stack .lm-StackedPanel, 46 | #jp-right-stack .lm-StackedPanel { 47 | flex: 1 1 auto; 48 | } 49 | -------------------------------------------------------------------------------- /packages/application/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/application/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase.test", 3 | "include": ["src/**/*", "test/**/*"], 4 | "references": [ 5 | { 6 | "path": "." 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /packages/console-extension/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/console-extension", 3 | "version": "7.5.0-alpha.0", 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 | "watch": "tsc -b --watch" 39 | }, 40 | "dependencies": { 41 | "@jupyter-notebook/application": "^7.5.0-alpha.0", 42 | "@jupyterlab/application": "~4.5.0-alpha.1", 43 | "@jupyterlab/console": "~4.5.0-alpha.1", 44 | "@jupyterlab/coreutils": "~6.5.0-alpha.1", 45 | "@lumino/algorithm": "^2.0.3" 46 | }, 47 | "devDependencies": { 48 | "rimraf": "^3.0.2", 49 | "typescript": "~5.5.4" 50 | }, 51 | "publishConfig": { 52 | "access": "public" 53 | }, 54 | "jupyterlab": { 55 | "extension": true 56 | }, 57 | "styleModule": "style/index.js" 58 | } 59 | -------------------------------------------------------------------------------- /packages/console-extension/style/base.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/packages/console-extension/style/base.css -------------------------------------------------------------------------------- /packages/console-extension/style/index.css: -------------------------------------------------------------------------------- 1 | @import url('./base.css'); 2 | -------------------------------------------------------------------------------- /packages/console-extension/style/index.js: -------------------------------------------------------------------------------- 1 | import './base.css'; 2 | -------------------------------------------------------------------------------- /packages/console-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 | -------------------------------------------------------------------------------- /packages/docmanager-extension/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/docmanager-extension", 3 | "version": "7.5.0-alpha.0", 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 | "watch": "tsc -b --watch" 39 | }, 40 | "dependencies": { 41 | "@jupyter-notebook/application": "^7.5.0-alpha.0", 42 | "@jupyterlab/application": "~4.5.0-alpha.1", 43 | "@jupyterlab/coreutils": "~6.5.0-alpha.1", 44 | "@jupyterlab/docmanager": "~4.5.0-alpha.1", 45 | "@jupyterlab/docregistry": "~4.5.0-alpha.1", 46 | "@jupyterlab/services": "~7.5.0-alpha.1", 47 | "@lumino/algorithm": "^2.0.3", 48 | "@lumino/signaling": "^2.1.4" 49 | }, 50 | "devDependencies": { 51 | "rimraf": "^3.0.2", 52 | "typescript": "~5.5.4" 53 | }, 54 | "publishConfig": { 55 | "access": "public" 56 | }, 57 | "jupyterlab": { 58 | "extension": true 59 | }, 60 | "styleModule": "style/index.js" 61 | } 62 | -------------------------------------------------------------------------------- /packages/docmanager-extension/style/base.css: -------------------------------------------------------------------------------- 1 | .jp-Document { 2 | height: 100%; 3 | } 4 | -------------------------------------------------------------------------------- /packages/docmanager-extension/style/index.css: -------------------------------------------------------------------------------- 1 | @import url('./base.css'); 2 | -------------------------------------------------------------------------------- /packages/docmanager-extension/style/index.js: -------------------------------------------------------------------------------- 1 | import './base.css'; 2 | -------------------------------------------------------------------------------- /packages/docmanager-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 | -------------------------------------------------------------------------------- /packages/documentsearch-extension/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/documentsearch-extension", 3 | "version": "7.5.0-alpha.0", 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 | "watch": "tsc -b --watch" 39 | }, 40 | "dependencies": { 41 | "@jupyter-notebook/application": "^7.5.0-alpha.0", 42 | "@jupyterlab/application": "~4.5.0-alpha.1", 43 | "@jupyterlab/documentsearch": "~4.5.0-alpha.1", 44 | "@lumino/widgets": "^2.7.1" 45 | }, 46 | "devDependencies": { 47 | "rimraf": "^3.0.2", 48 | "typescript": "~5.5.4" 49 | }, 50 | "publishConfig": { 51 | "access": "public" 52 | }, 53 | "jupyterlab": { 54 | "extension": true, 55 | "schemaDir": "schema" 56 | }, 57 | "styleModule": "style/index.js" 58 | } 59 | -------------------------------------------------------------------------------- /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 | description: 'A plugin to add document search functionalities', 22 | activate: ( 23 | app: JupyterFrontEnd, 24 | notebookShell: INotebookShell, 25 | registry: ISearchProviderRegistry 26 | ) => { 27 | // If a given widget is searchable, apply the searchable class. 28 | // If it's not searchable, remove the class. 29 | const transformWidgetSearchability = (widget: Widget | null) => { 30 | if (!widget) { 31 | return; 32 | } 33 | if (registry.hasProvider(widget)) { 34 | widget.addClass(SEARCHABLE_CLASS); 35 | } else { 36 | widget.removeClass(SEARCHABLE_CLASS); 37 | } 38 | }; 39 | 40 | // Update searchability of the active widget when the registry 41 | // changes, in case a provider for the current widget was added 42 | // or removed 43 | registry.changed.connect(() => 44 | transformWidgetSearchability(notebookShell.currentWidget) 45 | ); 46 | 47 | // Apply the searchable class only to the active widget if it is actually 48 | // searchable. Remove the searchable class from a widget when it's 49 | // no longer active. 50 | notebookShell.currentChanged.connect((_, args) => { 51 | if (notebookShell.currentWidget) { 52 | transformWidgetSearchability(notebookShell.currentWidget); 53 | } 54 | }); 55 | }, 56 | }; 57 | 58 | /** 59 | * Export the plugins as default. 60 | */ 61 | const plugins: JupyterFrontEndPlugin[] = [notebookShellWidgetListener]; 62 | 63 | export default plugins; 64 | -------------------------------------------------------------------------------- /packages/documentsearch-extension/style/base.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/packages/documentsearch-extension/style/base.css -------------------------------------------------------------------------------- /packages/documentsearch-extension/style/index.css: -------------------------------------------------------------------------------- 1 | @import url('./base.css'); 2 | -------------------------------------------------------------------------------- /packages/documentsearch-extension/style/index.js: -------------------------------------------------------------------------------- 1 | import './base.css'; 2 | -------------------------------------------------------------------------------- /packages/documentsearch-extension/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/help-extension/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/help-extension", 3 | "version": "7.5.0-alpha.0", 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 | "watch": "tsc -b --watch" 39 | }, 40 | "dependencies": { 41 | "@jupyter-notebook/ui-components": "^7.5.0-alpha.0", 42 | "@jupyterlab/application": "~4.5.0-alpha.1", 43 | "@jupyterlab/apputils": "~4.6.0-alpha.1", 44 | "@jupyterlab/mainmenu": "~4.5.0-alpha.1", 45 | "@jupyterlab/translation": "~4.5.0-alpha.1", 46 | "react": "^18.2.0", 47 | "react-dom": "^18.2.0" 48 | }, 49 | "devDependencies": { 50 | "rimraf": "^3.0.2", 51 | "typescript": "~5.5.4" 52 | }, 53 | "publishConfig": { 54 | "access": "public" 55 | }, 56 | "jupyterlab": { 57 | "extension": true, 58 | "schemaDir": "schema" 59 | }, 60 | "styleModule": "style/index.js" 61 | } 62 | -------------------------------------------------------------------------------- /packages/help-extension/schema/open.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 | } 19 | ] 20 | }, 21 | "properties": {}, 22 | "additionalProperties": false, 23 | "type": "object" 24 | } 25 | -------------------------------------------------------------------------------- /packages/help-extension/style/base.css: -------------------------------------------------------------------------------- 1 | .jp-AboutNotebook .jp-Dialog-header { 2 | justify-content: center; 3 | padding: 0; 4 | } 5 | 6 | .jp-AboutNotebook-header { 7 | display: flex; 8 | flex-direction: row; 9 | align-items: center; 10 | padding: var(--jp-flat-button-padding); 11 | } 12 | 13 | .jp-AboutNotebook-header-text { 14 | margin-left: 16px; 15 | } 16 | 17 | .jp-AboutNotebook-version { 18 | color: var(--jp-ui-font-color1); 19 | font-size: var(--jp-ui-font-size1); 20 | padding-bottom: 30px; 21 | font-weight: 400; 22 | letter-spacing: 0.4px; 23 | line-height: 1.12; 24 | min-width: 360px; 25 | text-align: center; 26 | } 27 | 28 | .jp-AboutNotebook-body { 29 | display: flex; 30 | font-size: var(--jp-ui-font-size2); 31 | padding: var(--jp-flat-button-padding); 32 | color: var(--jp-ui-font-color1); 33 | text-align: center; 34 | flex-direction: column; 35 | min-width: 360px; 36 | overflow: hidden; 37 | } 38 | 39 | .jp-AboutNotebook-about-body pre { 40 | white-space: pre-wrap; 41 | } 42 | 43 | .jp-AboutNotebook-about-externalLinks { 44 | display: flex; 45 | flex-direction: column; 46 | justify-content: flex-start; 47 | align-items: flex-start; 48 | color: var(--jp-warn-color0); 49 | } 50 | 51 | .jp-AboutNotebook-about-copyright { 52 | padding-top: 25px; 53 | } 54 | -------------------------------------------------------------------------------- /packages/help-extension/style/index.css: -------------------------------------------------------------------------------- 1 | @import url('./base.css'); 2 | -------------------------------------------------------------------------------- /packages/help-extension/style/index.js: -------------------------------------------------------------------------------- 1 | import './base.css'; 2 | -------------------------------------------------------------------------------- /packages/help-extension/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"], 8 | "references": [ 9 | { 10 | "path": "../ui-components" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /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 | "args": { 16 | "isMenu": true 17 | } 18 | }, 19 | { 20 | "command": "jupyter-notebook:open-lab", 21 | "rank": 10, 22 | "args": { 23 | "isMenu": true 24 | } 25 | }, 26 | { 27 | "command": "jupyter-notebook:open-nbclassic", 28 | "rank": 10, 29 | "args": { 30 | "isMenu": true 31 | } 32 | } 33 | ] 34 | } 35 | ] 36 | }, 37 | "properties": {}, 38 | "additionalProperties": false, 39 | "type": "object" 40 | } 41 | -------------------------------------------------------------------------------- /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/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 | 13 | .jp-InterfaceSwitcher .lm-MenuBar-itemIcon svg { 14 | vertical-align: sub; 15 | } 16 | 17 | .jp-nb-interface-switcher-button > .jp-ToolbarButtonComponent::part(content) { 18 | flex-direction: row-reverse; 19 | } 20 | 21 | .jp-nb-interface-switcher-button > .jp-ToolbarButtonComponent > svg { 22 | padding-left: 3px; 23 | } 24 | -------------------------------------------------------------------------------- /packages/lab-extension/style/index.css: -------------------------------------------------------------------------------- 1 | @import url('./base.css'); 2 | -------------------------------------------------------------------------------- /packages/lab-extension/style/index.js: -------------------------------------------------------------------------------- 1 | import './base.css'; 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /packages/notebook-extension/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/notebook-extension", 3 | "version": "7.5.0-alpha.0", 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 | "watch": "tsc -b --watch" 39 | }, 40 | "dependencies": { 41 | "@jupyter-notebook/application": "^7.5.0-alpha.0", 42 | "@jupyterlab/application": "~4.5.0-alpha.1", 43 | "@jupyterlab/apputils": "~4.6.0-alpha.1", 44 | "@jupyterlab/cells": "~4.5.0-alpha.1", 45 | "@jupyterlab/docmanager": "~4.5.0-alpha.1", 46 | "@jupyterlab/notebook": "~4.5.0-alpha.1", 47 | "@jupyterlab/settingregistry": "~4.5.0-alpha.1", 48 | "@jupyterlab/translation": "~4.5.0-alpha.1", 49 | "@lumino/polling": "^2.1.4", 50 | "@lumino/widgets": "^2.7.1", 51 | "react": "^18.2.0", 52 | "react-dom": "^18.2.0" 53 | }, 54 | "devDependencies": { 55 | "rimraf": "^3.0.2", 56 | "typescript": "~5.5.4" 57 | }, 58 | "publishConfig": { 59 | "access": "public" 60 | }, 61 | "jupyterlab": { 62 | "extension": true, 63 | "schemaDir": "schema" 64 | }, 65 | "styleModule": "style/index.js" 66 | } 67 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /packages/notebook-extension/schema/edit-notebook-metadata.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": "notebook:open-tree-tab", 11 | "rank": 1 12 | } 13 | ] 14 | }, 15 | { 16 | "id": "jp-mainmenu-edit", 17 | "items": [ 18 | { 19 | "type": "separator", 20 | "rank": 8.5 21 | }, 22 | { 23 | "command": "notebook:edit-metadata", 24 | "rank": 8.5 25 | }, 26 | { 27 | "type": "separator", 28 | "rank": 8.5 29 | } 30 | ] 31 | } 32 | ] 33 | }, 34 | "properties": {}, 35 | "additionalProperties": false, 36 | "type": "object" 37 | } 38 | -------------------------------------------------------------------------------- /packages/notebook-extension/schema/full-width-notebook.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Jupyter Notebook Full Width Notebook", 3 | "description": "Jupyter Notebook Notebook With settings", 4 | "jupyter.lab.menus": { 5 | "main": [ 6 | { 7 | "id": "jp-mainmenu-view", 8 | "items": [ 9 | { 10 | "command": "notebook:toggle-full-width", 11 | "rank": 4 12 | } 13 | ] 14 | } 15 | ] 16 | }, 17 | "properties": { 18 | "fullWidthNotebook": { 19 | "type": "boolean", 20 | "title": "Full Width Notebook", 21 | "description": "Whether to the notebook should take up the full width of the application", 22 | "default": false 23 | } 24 | }, 25 | "additionalProperties": false, 26 | "type": "object" 27 | } 28 | -------------------------------------------------------------------------------- /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/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/notebook-extension/style/index.css: -------------------------------------------------------------------------------- 1 | @import url('./base.css'); 2 | -------------------------------------------------------------------------------- /packages/notebook-extension/style/index.js: -------------------------------------------------------------------------------- 1 | import './base.css'; 2 | -------------------------------------------------------------------------------- /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/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/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/terminal-extension", 3 | "version": "7.5.0-alpha.0", 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 | "watch": "tsc -b --watch" 39 | }, 40 | "dependencies": { 41 | "@jupyter-notebook/application": "^7.5.0-alpha.0", 42 | "@jupyterlab/application": "~4.5.0-alpha.1", 43 | "@jupyterlab/coreutils": "~6.5.0-alpha.1", 44 | "@jupyterlab/terminal": "~4.5.0-alpha.1", 45 | "@lumino/algorithm": "^2.0.3" 46 | }, 47 | "devDependencies": { 48 | "rimraf": "^3.0.2", 49 | "typescript": "~5.5.4" 50 | }, 51 | "publishConfig": { 52 | "access": "public" 53 | }, 54 | "jupyterlab": { 55 | "extension": true 56 | }, 57 | "styleModule": "style/index.js" 58 | } 59 | -------------------------------------------------------------------------------- /packages/terminal-extension/style/base.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/packages/terminal-extension/style/base.css -------------------------------------------------------------------------------- /packages/terminal-extension/style/index.css: -------------------------------------------------------------------------------- 1 | @import url('./base.css'); 2 | -------------------------------------------------------------------------------- /packages/terminal-extension/style/index.js: -------------------------------------------------------------------------------- 1 | import './base.css'; 2 | -------------------------------------------------------------------------------- /packages/terminal-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 | -------------------------------------------------------------------------------- /packages/tree-extension/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/tree-extension", 3 | "version": "7.5.0-alpha.0", 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 | "watch": "tsc -b --watch" 39 | }, 40 | "dependencies": { 41 | "@jupyter-notebook/application": "^7.5.0-alpha.0", 42 | "@jupyter-notebook/tree": "^7.5.0-alpha.0", 43 | "@jupyterlab/application": "~4.5.0-alpha.1", 44 | "@jupyterlab/apputils": "~4.6.0-alpha.1", 45 | "@jupyterlab/coreutils": "~6.5.0-alpha.1", 46 | "@jupyterlab/docmanager": "~4.5.0-alpha.1", 47 | "@jupyterlab/filebrowser": "~4.5.0-alpha.1", 48 | "@jupyterlab/mainmenu": "~4.5.0-alpha.1", 49 | "@jupyterlab/services": "~7.5.0-alpha.1", 50 | "@jupyterlab/settingeditor": "~4.5.0-alpha.1", 51 | "@jupyterlab/settingregistry": "~4.5.0-alpha.1", 52 | "@jupyterlab/statedb": "~4.5.0-alpha.1", 53 | "@jupyterlab/translation": "~4.5.0-alpha.1", 54 | "@jupyterlab/ui-components": "~4.5.0-alpha.1", 55 | "@lumino/algorithm": "^2.0.3", 56 | "@lumino/commands": "^2.3.2", 57 | "@lumino/widgets": "^2.7.1" 58 | }, 59 | "devDependencies": { 60 | "rimraf": "^3.0.2", 61 | "typescript": "~5.5.4" 62 | }, 63 | "publishConfig": { 64 | "access": "public" 65 | }, 66 | "jupyterlab": { 67 | "extension": true, 68 | "schemaDir": "schema" 69 | }, 70 | "styleModule": "style/index.js" 71 | } 72 | -------------------------------------------------------------------------------- /packages/tree-extension/schema/file-actions.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "File Browser Widget - File Actions", 3 | "description": "File Browser widget - File Actions settings.", 4 | "jupyter.lab.toolbars": { 5 | "FileBrowser": [ 6 | { "name": "fileAction-placeholder", "rank": 0 }, 7 | { "name": "fileAction-open", "rank": 1 }, 8 | { "name": "fileAction-download", "rank": 2 }, 9 | { "name": "fileAction-rename", "rank": 3 }, 10 | { "name": "fileAction-duplicate", "rank": 4 }, 11 | { "name": "fileAction-delete", "rank": 5 } 12 | ] 13 | }, 14 | "properties": {}, 15 | "additionalProperties": false, 16 | "type": "object" 17 | } 18 | -------------------------------------------------------------------------------- /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 | { 8 | "name": "toggle-file-filter", 9 | "label": "", 10 | "command": "filebrowser:toggle-file-filter", 11 | "rank": 990 12 | }, 13 | { "name": "new-dropdown", "rank": 1000 }, 14 | { "name": "uploader", "rank": 1010 }, 15 | { "name": "refresh", "command": "filebrowser:refresh", "rank": 1020 } 16 | ] 17 | }, 18 | "jupyter.lab.transform": true, 19 | "properties": { 20 | "toolbar": { 21 | "title": "File browser toolbar items", 22 | "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:", 23 | "items": { 24 | "$ref": "#/definitions/toolbarItem" 25 | }, 26 | "type": "array", 27 | "default": [] 28 | } 29 | }, 30 | "additionalProperties": false, 31 | "type": "object", 32 | "definitions": { 33 | "toolbarItem": { 34 | "properties": { 35 | "name": { 36 | "title": "Unique name", 37 | "type": "string" 38 | }, 39 | "args": { 40 | "title": "Command arguments", 41 | "type": "object" 42 | }, 43 | "command": { 44 | "title": "Command id", 45 | "type": "string", 46 | "default": "" 47 | }, 48 | "disabled": { 49 | "title": "Whether the item is ignored or not", 50 | "type": "boolean", 51 | "default": false 52 | }, 53 | "icon": { 54 | "title": "Item icon id", 55 | "description": "If defined, it will override the command icon", 56 | "type": "string" 57 | }, 58 | "label": { 59 | "title": "Item label", 60 | "description": "If defined, it will override the command label", 61 | "type": "string" 62 | }, 63 | "type": { 64 | "title": "Item type", 65 | "type": "string", 66 | "enum": ["command", "spacer"] 67 | }, 68 | "rank": { 69 | "title": "Item rank", 70 | "type": "number", 71 | "minimum": 0, 72 | "default": 50 73 | } 74 | }, 75 | "required": ["name"], 76 | "additionalProperties": false, 77 | "type": "object" 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /packages/tree-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-FileBrowser-toolbar .jp-Toolbar-item.jp-DropdownMenu, 8 | .jp-FileBrowser-toolbar .jp-Toolbar-item.jp-ToolbarButton, 9 | .jp-FileBrowser-toolbar .jp-Toolbar-item.jp-CommandToolbarButton { 10 | border: solid 1px var(--jp-border-color2); 11 | margin: 1px; 12 | padding: 0px; 13 | } 14 | 15 | .jp-FileBrowser-toolbar > .jp-Toolbar-item.jp-ToolbarButton:hover, 16 | .jp-FileBrowser-toolbar > .jp-Toolbar-item.jp-CommandToolbarButton:hover, 17 | .jp-FileBrowser-toolbar > .jp-Toolbar-item.jp-DropdownMenu:hover { 18 | background: var(--neutral-fill-stealth-hover); 19 | } 20 | 21 | .jp-FileBrowser-toolbar .lm-MenuBar-item { 22 | height: var(--jp-private-toolbar-height); 23 | display: inline-flex; 24 | align-items: center; 25 | } 26 | 27 | .jp-FileBrowser-toolbar .jp-ToolbarButtonComponent { 28 | height: var(--jp-flat-button-height); 29 | } 30 | 31 | .jp-FileBrowser-toolbar jp-button.jp-ToolbarButtonComponent:hover { 32 | background: inherit; 33 | } 34 | 35 | .jp-DirListing-content .jp-DirListing-checkboxWrapper { 36 | visibility: visible; 37 | } 38 | 39 | /* Action buttons */ 40 | 41 | .jp-FileBrowser-toolbar > .jp-FileAction > .jp-ToolbarButtonComponent > svg { 42 | display: none; 43 | } 44 | 45 | .jp-FileBrowser-toolbar > #fileAction-delete { 46 | background-color: var(--jp-error-color1); 47 | } 48 | 49 | .jp-FileBrowser-toolbar 50 | .jp-ToolbarButtonComponent[data-command='filebrowser:delete'] 51 | .jp-ToolbarButtonComponent-label { 52 | color: var(--jp-ui-inverse-font-color1); 53 | } 54 | 55 | .jp-FileBrowser-toolbar .jp-FileAction { 56 | border: solid 1px var(--jp-border-color2); 57 | margin: 1px; 58 | min-height: var(--jp-private-toolbar-height); 59 | } 60 | 61 | body[data-format='mobile'] #fileAction-placeholder { 62 | display: none; 63 | } 64 | -------------------------------------------------------------------------------- /packages/tree-extension/style/index.css: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | | Copyright (c) Jupyter Development Team. 3 | | 4 | | Distributed under the terms of the Modified BSD License. 5 | |----------------------------------------------------------------------------*/ 6 | 7 | @import url('~@jupyterlab/filebrowser/style/index.css'); 8 | 9 | @import url('~@jupyter-notebook/tree/style/index.css'); 10 | 11 | @import './base.css'; 12 | -------------------------------------------------------------------------------- /packages/tree-extension/style/index.js: -------------------------------------------------------------------------------- 1 | import '@jupyterlab/filebrowser/style/index.js'; 2 | 3 | import '@jupyter-notebook/tree/style/index.js'; 4 | 5 | import './base.css'; 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /packages/tree/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/tree", 3 | "version": "7.5.0-alpha.0", 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 | "watch": "tsc -b --watch" 39 | }, 40 | "dependencies": { 41 | "@jupyter-notebook/application": "^7.5.0-alpha.0", 42 | "@jupyterlab/application": "~4.5.0-alpha.1", 43 | "@jupyterlab/apputils": "~4.6.0-alpha.1", 44 | "@jupyterlab/coreutils": "~6.5.0-alpha.1", 45 | "@jupyterlab/docmanager": "~4.5.0-alpha.1", 46 | "@jupyterlab/filebrowser": "~4.5.0-alpha.1", 47 | "@jupyterlab/mainmenu": "~4.5.0-alpha.1", 48 | "@jupyterlab/services": "~7.5.0-alpha.1", 49 | "@jupyterlab/settingregistry": "~4.5.0-alpha.1", 50 | "@jupyterlab/statedb": "~4.5.0-alpha.1", 51 | "@jupyterlab/translation": "~4.5.0-alpha.1", 52 | "@jupyterlab/ui-components": "~4.5.0-alpha.1", 53 | "@lumino/algorithm": "^2.0.3", 54 | "@lumino/commands": "^2.3.2", 55 | "@lumino/coreutils": "^2.2.1", 56 | "@lumino/widgets": "^2.7.1" 57 | }, 58 | "devDependencies": { 59 | "rimraf": "^3.0.2", 60 | "typescript": "~5.5.4" 61 | }, 62 | "publishConfig": { 63 | "access": "public" 64 | }, 65 | "styleModule": "style/index.js" 66 | } 67 | -------------------------------------------------------------------------------- /packages/tree/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './notebook-tree'; 2 | export * from './token'; 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | flex: 0 1 auto; 22 | color: var(--jp-ui-font-color0); 23 | font-size: var(--jp-ui-font-size1); 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 | jp-button[data-command='filebrowser:refresh'] .jp-ToolbarButtonComponent-label { 46 | display: none; 47 | } 48 | 49 | .jp-TreePanel .lm-TabBar-tabIcon svg { 50 | vertical-align: sub; 51 | } 52 | -------------------------------------------------------------------------------- /packages/tree/style/index.css: -------------------------------------------------------------------------------- 1 | @import url('~@jupyterlab/filebrowser/style/index.css'); 2 | 3 | @import url('./base.css'); 4 | -------------------------------------------------------------------------------- /packages/tree/style/index.js: -------------------------------------------------------------------------------- 1 | import '@jupyterlab/filebrowser/style/index.js'; 2 | 3 | import './base.css'; 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /packages/ui-components/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@jupyterlab/testutils/lib/babel.config'); 2 | -------------------------------------------------------------------------------- /packages/ui-components/jest.config.js: -------------------------------------------------------------------------------- 1 | const func = require('@jupyterlab/testutils/lib/jest-config'); 2 | module.exports = func(__dirname); 3 | -------------------------------------------------------------------------------- /packages/ui-components/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jupyter-notebook/ui-components", 3 | "version": "7.5.0-alpha.0", 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 | "test": "jest", 39 | "test:cov": "jest --collect-coverage", 40 | "test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand", 41 | "test:debug:watch": "node --inspect-brk node_modules/.bin/jest --runInBand --watch", 42 | "watch": "tsc -b --watch" 43 | }, 44 | "dependencies": { 45 | "@jupyterlab/ui-components": "~4.5.0-alpha.1", 46 | "react": "^18.2.0", 47 | "react-dom": "^18.2.0" 48 | }, 49 | "devDependencies": { 50 | "@babel/core": "^7.10.2", 51 | "@babel/preset-env": "^7.10.2", 52 | "@jupyterlab/testutils": "~4.3.2", 53 | "@types/jest": "^29.2.5", 54 | "babel-loader": "^8.0.6", 55 | "jest": "^29.3.1", 56 | "rimraf": "^3.0.2", 57 | "ts-jest": "^29.0.3", 58 | "typescript": "~5.5.4" 59 | }, 60 | "publishConfig": { 61 | "access": "public" 62 | }, 63 | "jupyterlab": { 64 | "coreDependency": true 65 | }, 66 | "styleModule": "style/index.js" 67 | } 68 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /packages/ui-components/style/base.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/packages/ui-components/style/base.css -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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/ui-components/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/ui-components/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfigbase.test", 3 | "include": ["src/**/*", "test/**/*"], 4 | "references": [ 5 | { 6 | "path": "." 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # setup.py shim for use with versions of JupyterLab that require 2 | # it for extensions. 3 | __import__("setuptools").setup() 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | "strictNullChecks": true, 18 | "target": "ES2018", 19 | "types": [], 20 | "lib": ["DOM", "DOM.Iterable", "ES2018", "ES2020.Intl"] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tsconfigbase.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "noEmitOnError": true, 5 | "noImplicitAny": true, 6 | "noUnusedLocals": true, 7 | "module": "commonjs", 8 | "moduleResolution": "node", 9 | "target": "ES2018", 10 | "lib": ["DOM", "DOM.iterable"], 11 | "types": ["jest", "node"], 12 | "jsx": "react", 13 | "resolveJsonModule": true, 14 | "esModuleInterop": true, 15 | "strictNullChecks": true 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /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 | "deduplicate": "jlpm dlx yarn-berry-deduplicate -s fewerHighest && jlpm install", 10 | "rimraf": "rimraf", 11 | "start": "jupyter notebook --config test/jupyter_server_config.py", 12 | "test": "playwright test", 13 | "test:debug": "PWDEBUG=1 playwright test", 14 | "test:report": "http-server ./playwright-report -a localhost -o", 15 | "test:update": "playwright test --update-snapshots" 16 | }, 17 | "dependencies": { 18 | "@jupyterlab/galata": "~5.5.0-alpha.1", 19 | "@playwright/test": "~1.52.0", 20 | "rimraf": "^3.0.2" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ui-tests/playwright.config.ts: -------------------------------------------------------------------------------- 1 | import baseConfig from '@jupyterlab/galata/lib/playwright-config'; 2 | 3 | module.exports = { 4 | ...baseConfig, 5 | use: { 6 | appPath: '', 7 | trace: 'on-first-retry', 8 | video: 'retain-on-failure', 9 | }, 10 | retries: 1, 11 | webServer: [ 12 | { 13 | command: 'jlpm start', 14 | port: 8888, 15 | timeout: 120 * 1000, 16 | reuseExistingServer: true, 17 | stdout: 'pipe', 18 | }, 19 | ], 20 | }; 21 | -------------------------------------------------------------------------------- /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 '@jupyterlab/galata'; 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 17 | .locator(`text=File Path${prevName}New Name >> input`) 18 | .fill(newName); 19 | 20 | await Promise.all([ 21 | await page.click('text="Rename"'), 22 | // wait until the URL is updated 23 | await page.waitForNavigation(), 24 | ]); 25 | }; 26 | 27 | test.describe('Editor', () => { 28 | test.beforeEach(async ({ page, tmpPath }) => { 29 | await page.contents.uploadFile( 30 | path.resolve(__dirname, `../../binder/${FILE}`), 31 | `${tmpPath}/${FILE}` 32 | ); 33 | }); 34 | 35 | test('Renaming the file by clicking on the title', async ({ 36 | page, 37 | tmpPath, 38 | }) => { 39 | const file = `${tmpPath}/${FILE}`; 40 | await page.goto(`edit/${file}`); 41 | 42 | // Click on the title 43 | await page.click(`text="${FILE}"`); 44 | 45 | const newName = 'test.yml'; 46 | await processRenameDialog(page, FILE, newName); 47 | 48 | // Check the URL contains the new name 49 | const url = page.url(); 50 | expect(url).toContain(newName); 51 | }); 52 | 53 | test('Renaming the file via the menu entry', async ({ page, tmpPath }) => { 54 | const file = `${tmpPath}/${FILE}`; 55 | await page.goto(`edit/${file}`); 56 | 57 | // Click on the title 58 | await page.menu.clickMenuItem('File>Rename…'); 59 | 60 | // Rename in the input dialog 61 | const newName = 'test.yml'; 62 | 63 | await processRenameDialog(page, FILE, newName); 64 | 65 | // Check the URL contains the new name 66 | const url = page.url(); 67 | expect(url).toContain(newName); 68 | }); 69 | }); 70 | -------------------------------------------------------------------------------- /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/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 '@jupyterlab/galata'; 7 | 8 | import { test } from './fixtures'; 9 | 10 | import { waitForNotebook } from './utils'; 11 | 12 | test.describe('General', () => { 13 | test('The notebook should render', async ({ page, tmpPath, browserName }) => { 14 | const notebook = 'simple.ipynb'; 15 | await page.contents.uploadFile( 16 | path.resolve(__dirname, `./notebooks/${notebook}`), 17 | `${tmpPath}/${notebook}` 18 | ); 19 | await page.goto(`notebooks/${tmpPath}/${notebook}`); 20 | 21 | // check the notebook footer shows up on hover 22 | const notebookFooter = '.jp-Notebook-footer'; 23 | await page.hover(notebookFooter); 24 | await page.waitForSelector(notebookFooter); 25 | 26 | // hover somewhere else to make the add cell disappear 27 | await page.hover('#jp-top-bar'); 28 | 29 | // click to make the blue border around the cell disappear 30 | await page.click('.jp-WindowedPanel-outer'); 31 | 32 | // wait for the notebook to be ready 33 | await waitForNotebook(page, browserName); 34 | 35 | expect(await page.screenshot()).toMatchSnapshot('notebook.png'); 36 | }); 37 | }); 38 | -------------------------------------------------------------------------------- /ui-tests/test/general.spec.ts-snapshots/notebook-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/general.spec.ts-snapshots/notebook-chromium-linux.png -------------------------------------------------------------------------------- /ui-tests/test/general.spec.ts-snapshots/notebook-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/general.spec.ts-snapshots/notebook-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/jupyter_server_config.py: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | 3 | from jupyterlab.galata import configure_jupyter_server 4 | 5 | c: Any 6 | c.JupyterNotebookApp.expose_app_in_browser = True 7 | 8 | configure_jupyter_server(c) 9 | -------------------------------------------------------------------------------- /ui-tests/test/layout.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 '@jupyterlab/galata'; 7 | 8 | import { galata } from '@jupyterlab/galata'; 9 | 10 | import { test } from './fixtures'; 11 | 12 | test.use({ 13 | mockSettings: { 14 | ...galata.DEFAULT_SETTINGS, 15 | '@jupyter-notebook/application-extension:shell': { 16 | layout: { 17 | Debugger: { area: 'left' }, 18 | }, 19 | }, 20 | }, 21 | }); 22 | 23 | test.describe('Layout Customization', () => { 24 | test('The Debugger panel should respect the settings and open in the left area', async ({ 25 | page, 26 | tmpPath, 27 | }) => { 28 | const notebook = 'simple.ipynb'; 29 | await page.contents.uploadFile( 30 | path.resolve(__dirname, `./notebooks/${notebook}`), 31 | `${tmpPath}/${notebook}` 32 | ); 33 | await page.goto(`notebooks/${tmpPath}/${notebook}`); 34 | 35 | const menuPath = 'View>Left Sidebar>Show Debugger'; 36 | 37 | await page.menu.clickMenuItem(menuPath); 38 | 39 | const panel = page.locator('#jp-left-stack'); 40 | expect(await panel.isVisible()).toBe(true); 41 | 42 | expect(await panel.screenshot()).toMatchSnapshot('debugger.png'); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /ui-tests/test/layout.spec.ts-snapshots/debugger-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/layout.spec.ts-snapshots/debugger-chromium-linux.png -------------------------------------------------------------------------------- /ui-tests/test/layout.spec.ts-snapshots/debugger-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/layout.spec.ts-snapshots/debugger-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/links.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 '@jupyterlab/galata'; 7 | 8 | import { test } from './fixtures'; 9 | 10 | const NOTEBOOK = 'local_links.ipynb'; 11 | const SUBFOLDER = 'test'; 12 | 13 | test.describe('Local Links', () => { 14 | test.beforeEach(async ({ page, tmpPath }) => { 15 | await page.contents.uploadFile( 16 | path.resolve(__dirname, `./notebooks/${NOTEBOOK}`), 17 | `${tmpPath}/${NOTEBOOK}` 18 | ); 19 | }); 20 | 21 | test('Open the current directory', async ({ page, tmpPath }) => { 22 | await page.goto(`notebooks/${tmpPath}/${NOTEBOOK}`); 23 | 24 | const [current] = await Promise.all([ 25 | page.waitForEvent('popup'), 26 | page.getByText('Current Directory').last().click(), 27 | ]); 28 | 29 | await current.waitForLoadState(); 30 | await current.waitForSelector('.jp-DirListing-content'); 31 | 32 | // Check that the link opened in a new tab 33 | expect(current.url()).toContain(`tree/${tmpPath}`); 34 | await current.close(); 35 | }); 36 | 37 | test('Open a folder', async ({ page, tmpPath }) => { 38 | // Create a test folder 39 | await page.contents.createDirectory(`${tmpPath}/${SUBFOLDER}`); 40 | 41 | await page.goto(`notebooks/${tmpPath}/${NOTEBOOK}`); 42 | 43 | const [folder] = await Promise.all([ 44 | page.waitForEvent('popup'), 45 | page.getByText('Open Test Folder').last().click(), 46 | ]); 47 | 48 | await folder.waitForLoadState(); 49 | await folder.waitForSelector('.jp-DirListing-content'); 50 | 51 | await folder.close(); 52 | 53 | // Check that the link opened in a new tab 54 | expect(folder.url()).toContain(`tree/${tmpPath}/${SUBFOLDER}`); 55 | }); 56 | }); 57 | -------------------------------------------------------------------------------- /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 '@jupyterlab/galata'; 9 | import { waitForKernelReady } from './utils'; 10 | 11 | const NOTEBOOK = 'empty.ipynb'; 12 | 13 | const MENU_PATHS = [ 14 | 'File', 15 | 'File>New', 16 | 'File>Save and Export Notebook As', 17 | 'Edit', 18 | 'View', 19 | 'Run', 20 | 'Kernel', 21 | 'Settings', 22 | 'Settings>Theme', 23 | 'Help', 24 | ]; 25 | 26 | test.use({ autoGoto: false }); 27 | 28 | test.describe('Notebook Menus', () => { 29 | test.beforeEach(async ({ page, tmpPath }) => { 30 | await page.contents.uploadFile( 31 | path.resolve(__dirname, `./notebooks/${NOTEBOOK}`), 32 | `${tmpPath}/${NOTEBOOK}` 33 | ); 34 | }); 35 | 36 | MENU_PATHS.forEach((menuPath) => { 37 | test(`Open menu item ${menuPath}`, async ({ page, tmpPath }) => { 38 | await page.goto(`notebooks/${tmpPath}/${NOTEBOOK}`); 39 | await waitForKernelReady(page); 40 | 41 | await page.menu.open(menuPath); 42 | expect(await page.menu.isOpen(menuPath)).toBeTruthy(); 43 | 44 | const imageName = `opened-menu-${menuPath.replace(/>/g, '-')}.png`; 45 | const menu = await page.menu.getOpenMenu(); 46 | expect(menu).toBeDefined(); 47 | expect(await menu?.screenshot()).toMatchSnapshot(imageName.toLowerCase()); 48 | }); 49 | }); 50 | }); 51 | -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-edit-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/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/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/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/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/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/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/menus.spec.ts-snapshots/opened-menu-file-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-file-new-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/menus.spec.ts-snapshots/opened-menu-file-new-chromium-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-file-new-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/menus.spec.ts-snapshots/opened-menu-file-new-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/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/menus.spec.ts-snapshots/opened-menu-file-save-and-export-notebook-as-chromium-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-file-save-and-export-notebook-as-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/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-help-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/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/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/menus.spec.ts-snapshots/opened-menu-help-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-kernel-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/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/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/menus.spec.ts-snapshots/opened-menu-kernel-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-run-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/menus.spec.ts-snapshots/opened-menu-run-chromium-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-run-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/menus.spec.ts-snapshots/opened-menu-run-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-settings-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/menus.spec.ts-snapshots/opened-menu-settings-chromium-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-settings-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/menus.spec.ts-snapshots/opened-menu-settings-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-settings-theme-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/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/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/menus.spec.ts-snapshots/opened-menu-settings-theme-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/menus.spec.ts-snapshots/opened-menu-view-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/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/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/menus.spec.ts-snapshots/opened-menu-view-firefox-linux.png -------------------------------------------------------------------------------- /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 { IJupyterLabPage, expect, galata } from '@jupyterlab/galata'; 5 | 6 | import { test } from './fixtures'; 7 | 8 | import { hideAddCellButton, waitForKernelReady } from './utils'; 9 | 10 | test.use({ 11 | autoGoto: false, 12 | viewport: { width: 524, height: 800 }, 13 | // Set a fixed string as Playwright is preventing the unique test name to be too long 14 | // and replaces part of the path with a hash 15 | tmpPath: 'mobile-layout', 16 | }); 17 | 18 | test.describe('Mobile', () => { 19 | // manually create the test directory since tmpPath is set to a fixed value 20 | test.beforeAll(async ({ request, tmpPath }) => { 21 | const contents = galata.newContentsHelper(request); 22 | await contents.createDirectory(tmpPath); 23 | }); 24 | 25 | test.afterAll(async ({ request, tmpPath }) => { 26 | const contents = galata.newContentsHelper(request); 27 | await contents.deleteDirectory(tmpPath); 28 | }); 29 | 30 | test('The layout should be more compact on the file browser page', async ({ 31 | page, 32 | tmpPath, 33 | }) => { 34 | await page.goto(`tree/${tmpPath}`); 35 | 36 | await page.waitForSelector('#top-panel-wrapper', { state: 'hidden' }); 37 | 38 | expect(await page.screenshot()).toMatchSnapshot('tree.png', { 39 | maxDiffPixels: 300, 40 | }); 41 | }); 42 | 43 | test('The layout should be more compact on the notebook page', async ({ 44 | page, 45 | tmpPath, 46 | browserName, 47 | }) => { 48 | await page.goto(`tree/${tmpPath}`); 49 | 50 | // Create a new notebook 51 | const notebookPromise = page.waitForEvent('popup'); 52 | await page.click('text="New"'); 53 | await page 54 | .locator( 55 | '[data-command="notebook:create-new"] >> text="Python 3 (ipykernel)"' 56 | ) 57 | .click(); 58 | const notebook = await notebookPromise; 59 | 60 | // wait for the kernel status animations to be finished 61 | await waitForKernelReady(notebook); 62 | 63 | // force switching back to command mode to avoid capturing the cursor in the screenshot 64 | await notebook.evaluate(async () => { 65 | await window.jupyterapp.commands.execute('notebook:enter-command-mode'); 66 | }); 67 | 68 | // TODO: remove 69 | if (browserName === 'firefox') { 70 | await hideAddCellButton(notebook); 71 | } 72 | 73 | expect(await notebook.screenshot()).toMatchSnapshot('notebook.png'); 74 | await notebook.close(); 75 | }); 76 | }); 77 | -------------------------------------------------------------------------------- /ui-tests/test/mobile.spec.ts-snapshots/notebook-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/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/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/mobile.spec.ts-snapshots/notebook-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/mobile.spec.ts-snapshots/tree-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/mobile.spec.ts-snapshots/tree-chromium-linux.png -------------------------------------------------------------------------------- /ui-tests/test/mobile.spec.ts-snapshots/tree-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/mobile.spec.ts-snapshots/tree-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/notebook.spec.ts-snapshots/notebook-full-width-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/notebook.spec.ts-snapshots/notebook-full-width-chromium-linux.png -------------------------------------------------------------------------------- /ui-tests/test/notebook.spec.ts-snapshots/notebook-full-width-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/notebook.spec.ts-snapshots/notebook-full-width-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/notebook.spec.ts-snapshots/notebooktools-right-panel-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/notebook.spec.ts-snapshots/notebooktools-right-panel-chromium-linux.png -------------------------------------------------------------------------------- /ui-tests/test/notebook.spec.ts-snapshots/notebooktools-right-panel-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/notebook.spec.ts-snapshots/notebooktools-right-panel-firefox-linux.png -------------------------------------------------------------------------------- /ui-tests/test/notebook.spec.ts-snapshots/toc-left-panel-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/notebook.spec.ts-snapshots/toc-left-panel-chromium-linux.png -------------------------------------------------------------------------------- /ui-tests/test/notebook.spec.ts-snapshots/toc-left-panel-firefox-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/notebook.spec.ts-snapshots/toc-left-panel-firefox-linux.png -------------------------------------------------------------------------------- /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": [ 10 | "print(\"1\\n\" * 200)" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": null, 16 | "id": "6f7028b9-4d2c-4fa2-96ee-bfa77bbee434", 17 | "metadata": {}, 18 | "outputs": [], 19 | "source": [ 20 | "print(\"1\\n\" * 20)" 21 | ] 22 | } 23 | ], 24 | "metadata": { 25 | "kernelspec": { 26 | "display_name": "Python 3 (ipykernel)", 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.9.7" 41 | } 42 | }, 43 | "nbformat": 4, 44 | "nbformat_minor": 5 45 | } 46 | -------------------------------------------------------------------------------- /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/test/notebooks/local_links.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "attachments": {}, 5 | "cell_type": "markdown", 6 | "metadata": {}, 7 | "source": [ 8 | "# Handle Local Links" 9 | ] 10 | }, 11 | { 12 | "attachments": {}, 13 | "cell_type": "markdown", 14 | "metadata": {}, 15 | "source": [ 16 | "[Current Directory](./)" 17 | ] 18 | }, 19 | { 20 | "attachments": {}, 21 | "cell_type": "markdown", 22 | "metadata": {}, 23 | "source": [ 24 | "[Open Test Folder](./test)" 25 | ] 26 | } 27 | ], 28 | "metadata": { 29 | "kernelspec": { 30 | "display_name": "Python 3 (ipykernel)", 31 | "language": "python", 32 | "name": "python3" 33 | }, 34 | "language_info": { 35 | "codemirror_mode": { 36 | "name": "ipython", 37 | "version": 3 38 | }, 39 | "file_extension": ".py", 40 | "mimetype": "text/x-python", 41 | "name": "python", 42 | "nbconvert_exporter": "python", 43 | "pygments_lexer": "ipython3", 44 | "version": "3.11.3" 45 | } 46 | }, 47 | "nbformat": 4, 48 | "nbformat_minor": 4 49 | } 50 | -------------------------------------------------------------------------------- /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 | "kernelspec": { 13 | "display_name": "Python 3 (ipykernel)", 14 | "language": "python", 15 | "name": "python3" 16 | }, 17 | "language_info": { 18 | "name": "python" 19 | }, 20 | "orig_nbformat": 4 21 | }, 22 | "nbformat": 4, 23 | "nbformat_minor": 2 24 | } 25 | -------------------------------------------------------------------------------- /ui-tests/test/notebooks/simple_toc.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# part 1" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "## subpart 1" 15 | ] 16 | }, 17 | { 18 | "cell_type": "markdown", 19 | "metadata": {}, 20 | "source": [ 21 | "## subpart 2" 22 | ] 23 | }, 24 | { 25 | "cell_type": "markdown", 26 | "metadata": {}, 27 | "source": [ 28 | "# part 2" 29 | ] 30 | }, 31 | { 32 | "cell_type": "markdown", 33 | "metadata": {}, 34 | "source": [ 35 | "# part 3" 36 | ] 37 | } 38 | ], 39 | "metadata": { 40 | "kernelspec": { 41 | "display_name": "Python 3 (ipykernel)", 42 | "language": "python", 43 | "name": "python3" 44 | }, 45 | "language_info": { 46 | "codemirror_mode": { 47 | "name": "ipython", 48 | "version": 3 49 | }, 50 | "file_extension": ".py", 51 | "mimetype": "text/x-python", 52 | "name": "python", 53 | "nbconvert_exporter": "python", 54 | "pygments_lexer": "ipython3", 55 | "version": "3.10.5" 56 | }, 57 | "vscode": { 58 | "interpreter": { 59 | "hash": "0508733a7f73e6ddc798c911e704189485d436785f398d29dd8c20885fc63cb3" 60 | } 61 | } 62 | }, 63 | "nbformat": 4, 64 | "nbformat_minor": 4 65 | } 66 | -------------------------------------------------------------------------------- /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, galata } from '@jupyterlab/galata'; 7 | 8 | // Set a fixed string as Playwright is preventing the unique test name to be too long 9 | // and replaces part of the path with a hash 10 | test.use({ autoGoto: false, tmpPath: 'settings' }); 11 | 12 | test.describe('Settings', () => { 13 | test.beforeAll(async ({ request, tmpPath }) => { 14 | const contents = galata.newContentsHelper(request); 15 | await contents.createDirectory(tmpPath); 16 | }); 17 | 18 | test.afterAll(async ({ request, tmpPath }) => { 19 | const contents = galata.newContentsHelper(request); 20 | await contents.deleteDirectory(tmpPath); 21 | }); 22 | 23 | test('Should be persisted after reloading the page', async ({ 24 | page, 25 | tmpPath, 26 | }) => { 27 | const showHeaderPath = 'View>Show Header'; 28 | 29 | await page.goto(`tree/${tmpPath}`); 30 | 31 | await page.waitForSelector('#top-panel', { state: 'visible' }); 32 | await page.menu.clickMenuItem(showHeaderPath); 33 | await page.waitForSelector('#top-panel', { state: 'hidden' }); 34 | await page.reload({ waitUntil: 'networkidle' }); 35 | await page.menu.getMenuItem(showHeaderPath); 36 | expect(await page.screenshot()).toMatchSnapshot('top-hidden.png', { 37 | maxDiffPixels: 300, 38 | }); 39 | 40 | await page.waitForSelector('#top-panel', { state: 'hidden' }); 41 | await page.menu.clickMenuItem(showHeaderPath); 42 | await page.waitForSelector('#top-panel', { state: 'visible' }); 43 | await page.reload({ waitUntil: 'networkidle' }); 44 | await page.menu.getMenuItem(showHeaderPath); 45 | expect(await page.screenshot()).toMatchSnapshot('top-visible.png', { 46 | maxDiffPixels: 300, 47 | }); 48 | }); 49 | }); 50 | -------------------------------------------------------------------------------- /ui-tests/test/settings.spec.ts-snapshots/top-hidden-chromium-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/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/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/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/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/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/jupyter/notebook/71532b93138c76e2e0ba543cd6333364e721e7f1/ui-tests/test/settings.spec.ts-snapshots/top-visible-firefox-linux.png -------------------------------------------------------------------------------- /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 '@jupyterlab/galata'; 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 | 40 | test('Should activate file browser tab', async ({ page, tmpPath }) => { 41 | await page.goto(`tree/${tmpPath}`); 42 | await page.locator('.jp-TreePanel >> text="Running"').click(); 43 | 44 | await expect( 45 | page.locator('#main-panel #jp-running-sessions-tree') 46 | ).toBeVisible(); 47 | 48 | await page.menu.clickMenuItem('View>File Browser'); 49 | await expect(page.locator('#main-panel #filebrowser')).toBeVisible(); 50 | }); 51 | -------------------------------------------------------------------------------- /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.keyboard.press('Shift+Enter'); 12 | } 13 | 14 | /** 15 | * Wait for the kernel to be ready 16 | */ 17 | export async function waitForKernelReady(page: Page): Promise { 18 | await page.waitForSelector('.jp-NotebookKernelStatus-fade'); 19 | await page.waitForFunction(() => { 20 | const status = window.document.getElementsByClassName( 21 | 'jp-NotebookKernelStatus' 22 | )[0]; 23 | 24 | if (!status) { 25 | return false; 26 | } 27 | 28 | const finished = status?.getAnimations().reduce((prev, curr) => { 29 | return prev && curr.playState === 'finished'; 30 | }, true); 31 | return finished; 32 | }); 33 | const viewport = page.viewportSize(); 34 | const width = viewport?.width; 35 | if (width && width > 600) { 36 | await page.waitForSelector('.jp-DebuggerBugButton[aria-disabled="false"]'); 37 | } 38 | } 39 | 40 | /** 41 | * Special case for firefox headless issue 42 | * See https://github.com/jupyter/notebook/pull/6872#issuecomment-1549594166 for more details 43 | */ 44 | export async function hideAddCellButton(page: Page): Promise { 45 | await page 46 | .locator('.jp-Notebook-footer') 47 | .evaluate((element) => (element.style.display = 'none')); 48 | } 49 | 50 | /** 51 | * Wait for the notebook to be ready 52 | */ 53 | export async function waitForNotebook( 54 | page: Page, 55 | browserName = '' 56 | ): Promise { 57 | // wait for the kernel status animations to be finished 58 | await waitForKernelReady(page); 59 | await page.waitForSelector( 60 | ".jp-Notebook-ExecutionIndicator[data-status='idle']" 61 | ); 62 | 63 | const checkpointLocator = '.jp-NotebookCheckpoint'; 64 | // wait for the checkpoint indicator to be displayed 65 | await page.waitForSelector(checkpointLocator); 66 | 67 | // remove the amount of seconds manually since it might display strings such as "3 seconds ago" 68 | await page 69 | .locator(checkpointLocator) 70 | .evaluate( 71 | (element) => (element.innerHTML = 'Last Checkpoint: 3 seconds ago') 72 | ); 73 | 74 | // special case for firefox headless issue 75 | // see https://github.com/jupyter/notebook/pull/6872#issuecomment-1549594166 for more details 76 | if (browserName === 'firefox') { 77 | await hideAddCellButton(page); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /ui-tests/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfigbase.test", 3 | "include": ["test/**/*"] 4 | } 5 | --------------------------------------------------------------------------------