Metadata-Version: 2.5
Name: slyde
Version: 0.0.1
Summary: Native wxPython slideshows backed by editable Python percent notebooks
Requires-Python: >=3.11
Requires-Dist: matplotlib>=3.8
Requires-Dist: mistune>=3.0
Requires-Dist: wxpython>=4.2
Description-Content-Type: text/markdown

# Slyde

> [!WARNING]
> This application is entirely vibe-coded. It is provided as-is, with no warranty of any kind.

Slyde is a native wxPython slideshow for editable Python percent notebooks. A slide is introduced by a `# %% Title [slide]` marker. Python and markdown cells after it belong to that slide until another slide marker appears.

## Set up

Install [uv](https://docs.astral.sh/uv/) and sync the project:

```sh
uv sync
```

On Linux, wxPython may need system GTK and WebKit development/runtime packages. Markdown uses `wx.html2.WebView` when available and falls back to `wx.html.HtmlWindow`.

## Launch

```sh
uv run slyde
uv run slyde examples/interactive.py
uv run slyde examples/animation.py
```

`examples/animation.py` builds a square wave out of sine harmonics and uses each of the `animate` settings described below.

Without a path, use **File → Open**. A notebook with PEP 723 inline metadata is started through `uv run --with` for each declared dependency; its packages are made available in the GUI process, so code and embedded Matplotlib widgets share the notebook's environment. uv must be installed and available on `PATH`. When opening such a notebook from the file picker, Slyde starts a new app process under uv and closes the current window. This first run may resolve and download packages.

The example declares its packages at the top of the notebook:

```python
# /// script
# requires-python = ">=3.11"
# dependencies = ["matplotlib", "numpy"]
# ///
```

Inline requirements are resolved by uv on demand. No adjacent lockfile is created automatically; add version bounds to dependency strings when a notebook needs tighter version constraints.

## Notebook format

```python
# /// script
# requires-python = ">=3.11"
# dependencies = ["matplotlib", "numpy"]
# ///

# %% Introduction [slide]
# %% [markdown]
# Use markdown cells to explain the idea.

# %% [slide]
# %% [markdown]
# Slides may contain more than one cell.

# %% Build a plot
import matplotlib.pyplot as plt
```

Supported cell types are Python (the default) and `[markdown]`. `[slide]` starts a new slide; text before the type marker is its optional title. Marker lines and the preamble are retained when saving. Only Python cells are editable in the UI.

A marker may carry `key="value"` options after its type. `[slide]` takes `animate`:

```python
# %% Results [slide] animate="bullet"
```

- `none` shows the whole slide at once, and is the default.
- `paragraph` reveals each top-level markdown block and each code cell one at a time.
- `bullet` does the same, and also reveals list items one at a time.

## Controls

- **Shift+Enter** runs the focused Python cell.
- The **Kernel** menu runs several cells at once or starts over:
  - **Run All Cells** (**Cmd+Shift+A**) runs every Python cell in the notebook.
  - **Run Until Current Slide** (**Cmd+Shift+U**) runs the Python cells on the slides before the current one.
  - **Restart Kernel & Clear All Cells** (**Cmd+Shift+R**) discards the shared namespace and every cell's output, after asking for confirmation.
- **Left/Up** and **Right/Down** change slides when focus is outside a code editor, and step through the content of an animated slide before moving on; **Cmd+Left/Up** and **Cmd+Right/Down** work even while editing a cell (the platform command key is Ctrl on Windows/Linux).
- **Cmd+plus** and **Cmd+minus** scale slide content between 50% and 200% (the platform command key is Ctrl on Windows/Linux).
- **F11** toggles full screen; **Escape** exits full screen.
- **Ctrl+S** saves edits to the source `.py` file.

Python cells run in a shared namespace in the GUI process, one at a time. Printed output and exceptions appear below the cell, and long lines scroll horizontally instead of wrapping. Matplotlib figures created by a cell are embedded as interactive wx canvases with the standard toolbar for home, back/forward, pan, zoom, and save. A code cell is as tall as its source, and the plot beside it takes the size Matplotlib needs for it. A plot shrinks by up to 30% when that makes the slide fit the window; otherwise it stays full size and the slide scrolls. Output appears as it is produced, and the window stays usable while a cell runs. A queued run from the **Kernel** menu shows its progress in a strip at the bottom of the window, and stops at the first cell that raises, moving to that slide.
