Metadata-Version: 2.3
Name: marimo-htmx
Version: 0.0.1
Summary: Project marimo notebook cells into custom HTMX interfaces
Author: Péter Ferenc Gyarmati
Author-email: Péter Ferenc Gyarmati <dev.petergy@gmail.com>
Requires-Dist: htpy>=26.5.1,<27
Requires-Dist: httpx>=0.28.1,<0.29
Requires-Dist: marimo>=0.23.15,<0.24
Requires-Python: >=3.11
Description-Content-Type: text/markdown

# marimo-htmx

`marimo-htmx` embeds selected outputs from an existing
[marimo](https://marimo.io/) notebook in a custom HTML interface. Marimo runs
Python on the server and synchronizes controls, plots, tables, and widgets with
each browser session.

Write the layout and styles with HTML and CSS. Add
[HTMX](https://htmx.org/) for server-driven fragments and DOM swaps.

> `marimo-htmx` is experimental. It currently supports Python 3.11 or newer
> and marimo 0.23.x.

## Get started

Replace `analysis.py` with your notebook:

```console
uvx marimo-htmx init analysis.py analysis-ui --snapshot
cd analysis-ui
uvx marimo-htmx dev .
```

`dev` opens the blank app and prints a cell catalog URL. Use the catalog to
choose an output. Native cell names work as written. For an anonymous cell,
assign its exact reference to a short name such as `summary` in
`pyproject.toml`.

Add the chosen name to `ui/index.html`:

```html
<main>
  <h1>Analysis</h1>
  <marimo-cell name="summary"></marimo-cell>
</main>
```

HTML changes reload the page. CSS changes refresh the stylesheet.

## Runtime model

- Notebook authoring uses ordinary Marimo cells.
- Marimo handles controls, tables, plots, and
  [anywidgets](https://anywidget.dev/).
- Application HTML defines the page structure, styling, and HTMX interactions.
- Each browser uses a server-backed Python session.

## Documentation

- [Getting started](docs/getting-started.md)
- [Build a page](docs/build-pages.md)
- [Project reference](docs/reference.md)
- [Deploy an app](docs/deployment.md)
- [Python API](docs/python-api.md)

Repository contributors should start with
[CONTRIBUTING.md](CONTRIBUTING.md). Architecture and release notes live in the
[development docs](development_docs/README.md).
