Scripts Overview

Use this command prefix for all script commands:

./

All commands below assume you are in dotlineform-site/.

Local environment variables (required for media/generation scripts):

export DOTLINEFORM_PROJECTS_BASE_DIR="/path/to/dotlineform"
export DOTLINEFORM_MEDIA_BASE_DIR="/path/to/dotlineform-icloud"

Sorting behavior and consistency contract:

Deferred improvements and follow-up items:

Main Pipeline

Run everything (copy -> srcset -> page generation):

./scripts/run_draft_pipeline.py --dry-run
./scripts/run_draft_pipeline.py

Useful flags:

Mode examples:

./scripts/run_draft_pipeline.py --mode moment --dry-run
./scripts/run_draft_pipeline.py --mode work --mode work_details --dry-run
./scripts/run_draft_pipeline.py --mode moment --moment-ids blue-sky,compiled --dry-run
./scripts/run_draft_pipeline.py --mode work --work-ids 00456 --dry-run

Note: when --mode work is used and no --series-ids* are provided, draft series are auto-included in generation.

Individual Scripts

1) Copy draft source images from workbook

Unified script with mode flags:

./scripts/copy_draft_media_files.py --mode work --ids-file /tmp/work_ids.txt --copied-ids-file /tmp/copied_work_ids.txt --write
./scripts/copy_draft_media_files.py --mode work_details --ids-file /tmp/detail_uids.txt --copied-ids-file /tmp/copied_detail_uids.txt --write
./scripts/copy_draft_media_files.py --mode moment --ids-file /tmp/moment_ids.txt --copied-ids-file /tmp/copied_moment_ids.txt --write

Flags:

2) Build srcset derivatives

MAKE_SRCSET_WORK_IDS_FILE=/tmp/copied_work_ids.txt \
MAKE_SRCSET_2400_IDS_FILE=/tmp/work_2400_ids.txt \
MAKE_SRCSET_SUCCESS_IDS_FILE=/tmp/work_success_ids.txt \
bash scripts/make_srcset_images.sh \
  "$DOTLINEFORM_MEDIA_BASE_DIR/works/make_srcset_images" \
  "$DOTLINEFORM_MEDIA_BASE_DIR/works/srcset_images" \
  4

Moments example (no 2400):

: > /tmp/empty_2400_ids.txt
MAKE_SRCSET_WORK_IDS_FILE=/tmp/copied_moment_ids.txt \
MAKE_SRCSET_2400_IDS_FILE=/tmp/empty_2400_ids.txt \
MAKE_SRCSET_SUCCESS_IDS_FILE=/tmp/moment_success_ids.txt \
bash scripts/make_srcset_images.sh \
  "$DOTLINEFORM_MEDIA_BASE_DIR/moments/make_srcset_images" \
  "$DOTLINEFORM_MEDIA_BASE_DIR/moments/srcset_images" \
  4

3) Generate Jekyll pages from workbook

./scripts/generate_work_pages.py data/works.xlsx
./scripts/generate_work_pages.py data/works.xlsx --write

Common scoped runs:

./scripts/generate_work_pages.py data/works.xlsx --work-ids 00456 --write
./scripts/generate_work_pages.py data/works.xlsx --work-ids-file /tmp/work_ids.txt --write
./scripts/generate_work_pages.py data/works.xlsx --series-ids curve-poems,dots --write

Useful flags:

Runtime canonical data flow:

3b) Tag Studio local save server

Run:

python3 scripts/studio/tag_write_server.py

Optional flags:

Behavior:

Security constraints:

Script logging:

3c) CSS token audit

Run:

python3 scripts/css_token_audit.py

Optional flags:

Behavior:

4) Audit site consistency (read-only)

Run an audit across generated pages and JSON:

./scripts/audit_site_consistency.py --strict

Scope and output options:

./scripts/audit_site_consistency.py \
  --checks cross_refs,schema,json_schema,links,media,orphans \
  --series-ids collected-1989-1998 \
  --json-out /tmp/site-audit.json \
  --md-out docs/audit-latest.md \
  --strict

Run a single check with the convenience alias:

./scripts/audit_site_consistency.py \
  --check-only schema \
  --max-samples 10

Or run multiple checks with repeated --check-only:

./scripts/audit_site_consistency.py \
  --check-only cross_refs \
  --check-only json_schema \
  --series-ids collected-1989-1998

Current checks:

--strict behavior and value:

Query contract map used by links check:

flow produced query keys destination accepts
series -> work series, series_page series, series_page, from, return_sort, return_dir, return_series, details_section, details_page
works index -> work from, return_sort, return_dir, return_series series, series_page, from, return_sort, return_dir, return_series, details_section, details_page
work -> work_details index from_work, from_work_title, section, section_label, series, series_page sort, dir, from_work, from_work_title, section, section_label, series, series_page
work -> work_details page from_work, from_work_title, section, details_section, details_page, series, series_page from_work, from_work_title, section, series, series_page, details_section, details_page, section_label
work_details page -> work series, series_page, details_section, details_page series, series_page, from, return_sort, return_dir, return_series, details_section, details_page

Orphan media scan (optional):

./scripts/audit_site_consistency.py \
  --check-only orphans \
  --orphans-media

Markdown report is written by default to docs/audit-latest.md (overwrites each run).

To write to a different path:

./scripts/audit_site_consistency.py \
  --md-out /tmp/site-audit.md

Known limits:

Warning policy:

5) Autofix missing numeric title_sort on works

Dry-run:

./scripts/fix_missing_title_sort.py

Write changes:

./scripts/fix_missing_title_sort.py --write

Scope to selected IDs/ranges:

./scripts/fix_missing_title_sort.py \
  --work-ids 66-74,38,40 \
  --write

Works download files

If Works.download is set, generation also copies that file and links it on the work page.