Metadata-Version: 2.4
Name: douwe
Version: 0.1.0
Summary: Run douwe.com projects locally from their standalone repositories.
Author: Douwe Osinga
Project-URL: Homepage, https://douwe.com/projects/douwe_runner
Project-URL: Repository, https://github.com/DOsinga/douwe_runner
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: Jinja2>=3.1
Requires-Dist: PyYAML>=6.0
Requires-Dist: tornado>=6.4

# Douwe Runner

Run one douwe.com project locally:

```bash
uvx douwe cambrium
```

or:

```bash
pipx run douwe cambrium
```

A bare name like `cambrium` resolves to `github.com/DOsinga/cambrium` and caches
the clone under `~/.cache/douwe/projects/`.

From the main douwe.com checkout, you can also run the development copy directly:

```bash
python projects/douwe_runner/douwe.py cambrium
```

Project references can be local or GitHub-backed:

```bash
python projects/douwe_runner/douwe.py cambrium
python projects/douwe_runner/douwe.py ./projects/cambrium
python projects/douwe_runner/douwe.py DOsinga/cambrium
python projects/douwe_runner/douwe.py https://github.com/DOsinga/cambrium
```

Inside the douwe.com checkout, a bare name like `cambrium` prefers
`./projects/cambrium`. Outside that checkout, it resolves to
`github.com/DOsinga/<name>`.

Useful options:

```bash
python projects/douwe_runner/douwe.py cambrium --embed
python projects/douwe_runner/douwe.py cambrium --no-browser
python projects/douwe_runner/douwe.py cambrium --port 9000
python projects/douwe_runner/douwe.py cambrium --refresh
```

Installed-package equivalents work the same way:

```bash
douwe cambrium --port 9000
douwe cambrium --refresh
```

The runner intentionally loads only the requested project. That keeps old or
dependency-heavy projects from breaking otherwise simple projects.

This version uses Tornado for serving and Jinja2 for project template rendering.
It does not call Django's renderer or configure Django settings. `{% load static
%}` is stripped from project templates, `{{ static }}` points at `./static/`,
and `{% static "..." %}` is rewritten to a shared `./_site_static/...` URL.

Projects that require WebSockets still need the full Django/Channels site for
now, but Tornado gives the runner a natural place to add that later.

Independent repos should eventually include their own `<project>.html` file with
the existing info block. During migration, if a GitHub repo has no HTML info
block but this checkout has `projects/<project>/<project>.html`, the runner uses
that local manifest and serves assets from the cloned repo first.

## Publishing

Build the package:

```bash
python -m build
```

Publish to PyPI:

```bash
python -m twine upload dist/*
```

After that, the globally runnable path is:

```bash
uvx douwe cambrium
```
