Convert render-legal to TypeScript

The repo is a Node/TS stack, so a Python renderer is out of place.
Port the script to TypeScript, runnable via
`node --experimental-strip-types scripts/render-legal.ts <doc>`, and
update the README to match.

Verified byte-identical output against the Python version before
removing it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ullrich Schäfer 2026-04-19 07:52:53 +02:00
parent d52828543a
commit 2abc207c2f
No known key found for this signature in database
GPG key ID: A32FF691A0F752D9
3 changed files with 133 additions and 129 deletions

View file

@ -40,14 +40,14 @@ corresponding legal page on the day the snapshot was taken.
## How to render
The snapshots are plain markdown extracted from the TSX source by
stripping JSX tags / attributes and resolving the `operator.*`
placeholders. Same approach as the pbcopy export used during legal
reviews. One-liner (from repo root):
Snapshots are extracted from the TSX source by stripping JSX tags /
attributes and resolving the `operator.*` placeholders plus the
constants from `apps/journal/app/lib/legal.ts`. One-liner (from repo
root):
```bash
python3 scripts/render-legal.py <doc> > docs/legal-archive/<doc>-YYYY-MM-DD.md
node --experimental-strip-types scripts/render-legal.ts <doc> \
> docs/legal-archive/<doc>-YYYY-MM-DD.md
```
(If `scripts/render-legal.py` doesn't exist yet, the extraction logic is
in the commit that seeded this directory — see PR history.)
where `<doc>` is one of `terms`, `privacy`, `imprint`.