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.1.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.1-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: purdue_af_vscode_button-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 3080efa5e003892e86e53c1f3dc2dd1dc7347d26b4486ef71739259356e6e889
MD5 522195c348933c83691de002e7669da6
BLAKE2b-256 00d3600b70d01caaa6900ff99d91b105bcde5850d52120cabb5ef624a5e1b893

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for purdue_af_vscode_button-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dc2a1a94586ecdff9942f2bb1f7e38913098e435e7644d3d37330cefaf3d0786
MD5 49bec752a808bc88ecb153f5ece4c88a
BLAKE2b-256 07bb6d6b8541ba1c099942db107b955f80aab4d3c688e436e63300198f7edea8

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