Skip to content

The record

William Jacoby edited this page Oct 14, 2026 · 1 revision

The record

data/templates.json records every template fetched or rejected, by its wiki and page ID (enwiki:1208356; the page ID stays the same when a page is renamed), with the revision that was looked at, its status (fetched, needs adapting, adapted or not adaptable) and why. Commit it with the templates, so everyone sees what was already tried.

  • A template recorded at its latest revision is not downloaded again: only its page info is read, which is cheap. --force fetches it anyway.

  • Once a template is adapted and passes the header check, record it as such. It stays at the revision that was fetched, so --check-updates still reports later edits to the original:

    python3 tools/fetch_template.py --mark-adapted Main
  • A template that can't reasonably be adapted, for example one built on a large Lua module, is recorded without writing a file:

    python3 tools/fetch_template.py --mark-unadaptable Ambox --reason "Lua: Module:Message box is too large to rewrite"
  • --check-updates reports every recorded template, from every wiki, that was edited, renamed or deleted since it was recorded. That covers rejected ones that might be adaptable now and adapted ones that might have fixes worth taking. It changes nothing; fetching or marking a template again records its new revision.

    python3 tools/fetch_template.py --check-updates

Templates copied by hand from Fandom aren't in the record, so --check-updates doesn't cover them.

Clone this wiki locally