Metadata-Version: 2.4
Name: spyder-toggle
Version: 0.1.0
Summary: Spyder plugin for cycling comment-based toggles in the current editor file
Home-page: https://github.com/hruskamiro/spyder-toggle
Author: Miroslav Hruska
Author-email: hruska.miro@gmail.com
License: MIT
Project-URL: Source, https://github.com/hruskamiro/spyder-toggle
Project-URL: Issues, https://github.com/hruskamiro/spyder-toggle/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: X11 Applications :: Qt
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
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: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Editors :: Integrated Development Environments (IDE)
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: spyder<7,>=5.4
Requires-Dist: qtpy
Dynamic: license-file

# spyder-toggle

Spyder plugin for cycling comment-based toggles in the current editor file.

Status: Alpha

Supports Spyder `>=5.4,<7`.

## Quick Start

Default shortcut: **`Ctrl+Alt+/`**

Install the latest released version:

```bash
pip install spyder-toggle
```

Then restart Spyder.

## Compatibility

- Spyder 5.4.x and 6.x
- Python 3.8+

## Current Behavior

- Registers a Spyder plugin named `spyder_toggle`
- Creates an editor-context action: `Toggle comments by group`
- Registers a default shortcut: `Ctrl+Alt+/`
- Detects markers like `$u-0`, `$u-1`, `$p-0`, ...
- If a marker appears on a `#%%` cell header, toggles the whole cell body while keeping the header commented
- Shows a preview dialog with current group states and toggle lines
- Lets you type a group label (for example `u`) and press Enter to cycle to next
- Pressing Enter on empty input closes the dialog
- Warns when group state is inconsistent (must have exactly one active line)

## Example

Use the same marker label with different numeric ids to define one toggle
group. Keep exactly one block active and leave the other blocks commented:

```python
#%% $config-0
PROCESSES = 8
MAX_MEMORY_GB = 16

#%% $config-1
# PROCESSES = 1
# MAX_MEMORY_GB = 32

#%% $config-2
# PROCESSES = 16
# MAX_MEMORY_GB = 64
```

In this example, `$config-0` is active. Running `Toggle comments by group`
and entering `config` cycles to the next config block.

## Installation

Inside the same environment where Spyder runs:

Install the latest released version from PyPI:

```bash
pip install spyder-toggle
```

Or install directly from GitHub:

```bash
pip install "git+https://github.com/hruskamiro/spyder-toggle.git@main"
```

Then restart Spyder.

## Verify Plugin Is Loaded

In **Spyder Internal Console**:

```python
p = spy.window.get_plugin("spyder_toggle")
print(p)
```

If loaded, `p` is not `None`.
