Skip to content

The header

William Jacoby edited this page Oct 15, 2026 · 2 revisions

The header

One file per template in templates/, named after the source template (Main.wiki, See also.wiki, ...), so text pasted from the source wiki finds the same names and parameters. Every file starts with this header:

<noinclude>
Source: https://en.wikipedia.org/wiki/Template:Main
History: https://en.wikipedia.org/w/index.php?title=Template:Main&action=history
Adapted by phpBB Modders.
Changes: rewritten without Lua; the "selfref" option removed.
Licence: CC BY-SA 4.0, https://creativecommons.org/licenses/by-sa/4.0/
</noinclude>

fetch_template.py writes it, with a Revision line for the exact version copied; you fill in Changes and add Example: lines (Checking a template).

The header meets what Wikipedia asks of a reuser: it links the page copied and its history (which lists the authors), says the copy was changed, and states the licence. It sits inside <noinclude>, so it shows on the template's own page on the board but not in the articles that use it.

Templates written here

A template written for the repository rather than adapted, such as Start Article.wiki (the skeleton the board's Start from choice offers for a new article), names no source page. Its header says so instead, keeps the licence line so the repository stays under one licence, and needs no History or Changes line:

<noinclude>
Source: phpBB Modders (own work)
What the template is for.
Licence: CC BY-SA 4.0, https://creativecommons.org/licenses/by-sa/4.0/
</noinclude>

compare_template.py skips these, since there is no source wiki to compare with, and the wiki extension's install page accepts them like the others.

Braces in the header

Since the header is the documentation on the template's page, a template call written in it is run there. Only Example: and Expect: lines may hold {{ or }}; write a function's name without braces anywhere else, such as "#if".

The Check workflow runs tools/check_headers.py on every push and pull request. It fails when a template is missing any of these lines, still says Changes: TODO, still has a Needs adapting: line, or has braces outside its examples:

python3 tools/check_headers.py

This is not legal advice. Wikipedia's Reusing Wikipedia content page and the Wikimedia Terms of Use say each reuser must work out how the licences apply to them.

Clone this wiki locally