Repository navigation
Checking a template
Give each template one or more Example: lines in its header, one call each. They also show as documentation on the template's own page on a board:
Example: {{Main|History of phpBB}}
Example: {{Main|Installation|Upgrading}}
tools/compare_template.py renders each example twice and compares the text a reader sees:
-
on the wiki it came from, with the original template, through that wiki's API (
action=parse). That is the template's current version there, which may be newer than the one copied. -
on a phpBB test board with the phpBB Modders wiki extension, using this repository's templates, through
tools/render_on_board.php. It loads the board with seed-forum'sbin/seed-bootstrap.php, puts every template in this repository on the board inside a database transaction, and rolls it back afterwards, so the board is left as it was.
python3 tools/compare_template.py --board ~/boards/wiki Main NowrapEach example prints MATCH, or DIFFER with both texts and the words that differ. --all checks every template. --board defaults to $WIKI_TEMPLATES_BOARD, and --bootstrap to $SEED_FORUM_BOOTSTRAP, or to a seed-forum checkout next to this repository.
When an adaptation deliberately differs from the original, for example leaving out links that only make sense on Wikipedia, add an Expect: line right under the example. It holds wiki text the example should render the same as, and it's rendered on the board too, so magic words such as {{SITENAME}} work:
Example: {{Stub}}
Expect: This article is a stub. You can help {{SITENAME}} by adding missing information.
That example is compared with its Expect: text instead of the original, and prints EXPECTED when they match. The original's text is still printed, so a reviewer can see what was left out. Templates copied from Fandom are rendered on the board only (BOARD ONLY), since Fandom's terms forbid automated access.
-
Inline HTML. The wiki only allows HTML tables in articles and templates, so a
<span>,<div>or<b>from the original is shown as text. phpBB's BBCode often does the same job:[b],[i],[size=85]. -
Spaces lost at the edges of
#ifand similar. Their results are trimmed, on the wiki as on Wikipedia, so a plain space there is dropped. Write to keep it, as Wikipedia's templates do.