Skip to main content

Adds a VS Code topbar button to JupyterLab.

Project description

purdue_af_vscode_button

Adds a JupyterLab topbar button that opens the proxied code-server (VS Code) interface in a new browser tab.

Command ID

Register this command in top-bar.jupyterlab-settings:

jupyterlab-topbar:switch-to-vscode

Top bar configuration

Add the button to .jupyter/lab/user-settings/@jupyterlab/application-extension/top-bar.jupyterlab-settings (or via config-extensions.sh in the purdue-af image):

{
    "toolbar": [
        {
            "name": "vscode",
            "command": "jupyterlab-topbar:switch-to-vscode",
            "disabled": false,
            "rank": 155
        },
        {
            "name": "shutdown",
            "command": "jupyterlab-topbar:shutdown",
            "disabled": false,
            "rank": 160
        }
    ]
}

Clicking the button opens {baseUrl}vscode/?folder=/home/{username} in a new tab, using the Jupyter single-user server baseUrl (no hardcoded hostnames).

purdue-af image integration (downstream)

After publishing to PyPI, update the purdue-af repository:

  1. docker/purdue-af/pixi.toml — add purdue-af-vscode-button = "==0.1.0" (or purdue_af_vscode_button per your lockfile convention).
  2. docker/purdue-af/scripts/config-extensions.sh — add the topbar entry shown above before the shutdown button.

Requirements

  • JupyterLab >= 4.0.0

Install

pip install purdue_af_vscode_button

Uninstall

pip uninstall purdue_af_vscode_button

Contributing

Development install

Note: You will need NodeJS to build the extension package.

The jlpm command is JupyterLab's pinned version of yarn that is installed with JupyterLab. You may use yarn or npm in lieu of jlpm below.

# Change directory to the purdue-af-vscode-button directory
pip install -e "."
jupyter labextension develop . --overwrite
jlpm build
jlpm watch
jupyter lab

Development uninstall

pip uninstall purdue_af_vscode_button

Remove the purdue-af-vscode-button symlink from the labextensions folder reported by jupyter labextension list.

Packaging the extension

See RELEASE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

purdue_af_vscode_button-0.1.2.tar.gz (83.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

purdue_af_vscode_button-0.1.2-py3-none-any.whl (29.6 kB view details)

Uploaded Python 3

File details

Details for the file purdue_af_vscode_button-0.1.2.tar.gz.

File metadata

  • Download URL: purdue_af_vscode_button-0.1.2.tar.gz
  • Upload date:
  • Size: 83.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for purdue_af_vscode_button-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4946f41be8a92e0369b535f9d30508edb69860dbb6efd47d2f2b693c289977e4
MD5 15af6f2cea9695a437d67d8865145ee2
BLAKE2b-256 33d54a6c1b2996abba9091d1209d9f276a36564bfaec41942bd557a4adaab5f1

See more details on using hashes here.

File details

Details for the file purdue_af_vscode_button-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for purdue_af_vscode_button-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1ac4eb7f0af1398886c9dd9707447940742e0fa47e9bb763fb5d6cfb11c5344b
MD5 43b2eddc5ac146c5f048acc85014f5cb
BLAKE2b-256 0e18dbd0de664ac7ddf40574cc266fdc12f613b956892f09a9eb73b6f45b700d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page