78 lines
2.0 KiB
Markdown
78 lines
2.0 KiB
Markdown
# Wedding Newspaper Generator
|
|
|
|
A fully-local tool that turns markdown/text content into a printable wedding
|
|
newspaper — rendered as a classic broadsheet HTML page you open in your browser
|
|
and print to A4. Nothing is deployed, served, or published beyond your machine.
|
|
|
|
## How it works
|
|
|
|
```
|
|
your/issue/
|
|
config.json # masthead metadata: title, couple names, date, issue, volume
|
|
content/ # markdown/.txt article files (optional front-matter)
|
|
lead.md
|
|
funnies.md
|
|
```
|
|
|
|
```bash
|
|
cd newspaper
|
|
uv sync --extra dev # first time only
|
|
uv run python -m newspaper.generator.cli --project /path/to/your/issue
|
|
```
|
|
|
|
This writes `newspaper.html` in your issue folder — a self-contained,
|
|
zero-network, A4-printable page. Open it via `file://` and choose **Print → A4**
|
|
from the browser.
|
|
|
|
> **Why `file://` is fine here:** the generator bakes all content into the HTML
|
|
> at build time, so the printed page makes no network requests. If AI-draft / live
|
|
> cartoons are wired in later, those happen at *generation time* — the emitted
|
|
> page stays self-contained.
|
|
|
|
## Packages
|
|
|
|
| Package | Role |
|
|
|---|---|
|
|
| `newspaper/generator/` | CLI, config + content ingestion, column-flow A4 layout, self-contained emit |
|
|
| `newspaper/ai_draft/` | optional AI copy drafting (DraftBundle handoff, fail-soft) |
|
|
| `newspaper/funnies/` | find-a-word, crossword, cartoon selection from content |
|
|
|
|
## Content authoring
|
|
|
|
Each file in `content/` becomes an article. Optional YAML front-matter:
|
|
|
|
```markdown
|
|
---
|
|
headline: The Big Day
|
|
byline: Sam & Alex
|
|
section: Front Page
|
|
---
|
|
Body text here. Vows said & dancing began.
|
|
```
|
|
|
|
## Tests
|
|
|
|
```bash
|
|
uv run pytest newspaper/tests/ -q # 22 tests, all passing
|
|
```
|
|
|
|
CI runs the same suite via Gitea Actions (`.gitea/workflows/test.yml`).
|
|
The pipeline is **tests-only** — there is no build/deploy/publish step.
|
|
|
|
## Config
|
|
|
|
`config.json`:
|
|
```json
|
|
{
|
|
"title": "The Wedding Times",
|
|
"couple_names": "Sam & Alex",
|
|
"date_line": "Sat 14 Sep",
|
|
"issue_number": "1",
|
|
"volume": "1"
|
|
}
|
|
```
|
|
|
|
## License
|
|
|
|
MIT
|