Metadata-Version: 2.4
Name: purdue_af_vscode_button
Version: 0.1.0
Dynamic: Keywords
Summary: Adds a VS Code topbar button to JupyterLab.
Project-URL: Repository, https://github.com/PurdueAF/purdue-af-extensions.git
Author-email: Dmitry Kondratyev <kondratyev.d.95@gmail.com>
License: BSD 3-Clause License
        
        Copyright (c) 2024, Dmitry Kondratyev
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License-File: LICENSE
Classifier: Framework :: Jupyter
Classifier: Framework :: Jupyter :: JupyterLab
Classifier: Framework :: Jupyter :: JupyterLab :: 4
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# 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):

```json
{
    "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

```bash
pip install purdue_af_vscode_button
```

## Uninstall

```bash
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](https://yarnpkg.com/) that is installed with JupyterLab. You may use
`yarn` or `npm` in lieu of `jlpm` below.

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

```bash
jlpm watch
jupyter lab
```

### Development uninstall

```bash
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](RELEASE.md)
