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.0.tar.gz (83.8 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.0-py3-none-any.whl (29.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: purdue_af_vscode_button-0.1.0.tar.gz
  • Upload date:
  • Size: 83.8 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.0.tar.gz
Algorithm Hash digest
SHA256 67987f85823fa1a398a59631676cf15dab5031ebb56af454ad90d05514444d3d
MD5 6e406d19e55edad1f546bb48b707658d
BLAKE2b-256 57485091b57aadcca309112bb1ab7c230b13b82df3853127742ef0174641cbf8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for purdue_af_vscode_button-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06fa76a9311febf682a3d286fc99de352539568d8dad8c0a97a8adef59164442
MD5 997b857649c40427724822a476ea790b
BLAKE2b-256 7ea5510c9e6fad0d461c78911290960ab84c67bba0697ebf8880183ce982f4c7

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