republisher/demo/README.md

72 lines
2.3 KiB
Markdown
Raw Normal View History

2026-03-29 13:52:23 +02:00
# Demo
This directory shows the runtime-config setup with a dedicated config file.
## Local Run
From the repo root:
```shell
uv run repub --config demo/repub.toml
```
Because `out_dir` in [`demo/repub.toml`](/home/abel/src/guardianproject/anynews/republisher-redux/demo/repub.toml) is relative, output is written under `demo/out/`.
## Files
- `repub.toml`: example runtime config with feed definitions, slugs, and Scrapy overrides
2026-03-29 14:10:20 +02:00
- `fixtures/local-feed.rss`: simple local RSS fixture for `file://` feed testing
2026-05-27 10:13:06 +02:00
## Image Profiles
The demo config uses the default image profiles from `repub/settings.py`.
`REPUBLISHER_IMAGE` controls full-size image variants; the first profile is the
canonical image URL written into feeds. `REPUBLISHER_IMAGE_THUMBNAILS` controls
named thumbnail variants for explicit item image media.
By default, mirrored image source bytes are kept under `images/source/`, full
profile variants are written under `images/full/`, and thumbnail profile
variants are written under `images/thumbs/` inside each feed output directory.
Edit the Scrapy settings in [`demo/repub.toml`](/home/abel/src/guardianproject/anynews/republisher-redux/demo/repub.toml)
when a demo run needs to disable thumbnails or test a different profile set.
2026-05-27 13:04:47 +02:00
## Media Cleanup
Published media can remain on disk after articles fall out of the current feed.
Run cleanup in dry-run mode first:
```shell
uv run repub cleanup-media --config demo/repub.toml --dry-run
```
With `--config`, cleanup scans `demo/out/feeds/` and honors any
`REPUBLISHER_*_DIR` media directory overrides in the config. Remove `--dry-run`
to delete old unreferenced media. The default retention window is 25 days; use
`--days N` to override it.
2026-03-29 14:10:20 +02:00
## Local File Feed
`repub` already accepts absolute `file://` feed URIs. To point it at the demo fixture, generate an absolute URI like this from the repo root:
```shell
python3 -c 'from pathlib import Path; print(Path("demo/fixtures/local-feed.rss").resolve().as_uri())'
```
Then use that value in a config entry:
```toml
[[feeds]]
name = "Local Demo"
slug = "local-demo"
2026-03-29 14:10:20 +02:00
url = "file:///absolute/path/to/demo/fixtures/local-feed.rss"
```
## Pygea Import
`repub` can also load additional `[[feeds]]` entries from a separate TOML file,
such as `pygea`'s generated `manifest.toml`:
```toml
feed_config_files = ["/absolute/path/to/pygea/feed/manifest.toml"]
```