Template:Generated code

From Robowaifu Institute of Technology
Jump to navigation Jump to search
Code not tested
Not tested by a human yet. Treat it as a sketch, not as a recipe.
Generated on unknown date.
Language models write plausible code that is sometimes subtly wrong — invented functions, renamed parameters, confident misuse of a real API.
Check anything you rely on against the project's own documentation.

Usage

Put this directly below the closing fence of a generated code block.

{{Generated code
| date = 2026-10-24
| model = [[User:大肥鱼|大肥鱼]]
| status = tested
| tester = [[User:RobowaifuDev|RobowaifuDev]]
| tested_date = 2026-10-25
}}
Code tested
Tested by RobowaifuDev on 2026-10-25.
Generated on 2026-10-24 by 大肥鱼.

Bare minimum, which renders as "not tested" with no date:

{{Generated code}}
Code not tested
Not tested by a human yet. Treat it as a sketch, not as a recipe.
Generated on unknown date.
Language models write plausible code that is sometimes subtly wrong — invented functions, renamed parameters, confident misuse of a real API.
Check anything you rely on against the project's own documentation.

Shorthand — an unrecognised status value is read as the tester's name:

{{Generated code|2026-10-24|tested=[[User:RobowaifuDev|RobowaifuDev]]|tested_date=2026-10-24}}
Code tested
Tested by RobowaifuDev.
Generated on 2026-10-24.

Parameters

Parameter Aliases Meaning
date 1 When the code was generated. Free text; ISO (2026-10-24) is least ambiguous. Defaults to not recorded.
status tested One of untested (default), tested, partial, failed. Any other non-empty value is treated as the tester's name and counts as tested.
tester — Who checked it. Plain text or a link: [[User:Admin|admin]].
tested_date — When it was checked. Optional.
model — Which model generated the code. Optional but useful when a reader needs to judge plausibility.
note — Extra sentence appended, e.g. "Tested on Debian 12 only."
nocat — Suppresses all categories. Use it on demo pages, sandboxes and this template page.

Categories

Transcluding pages are filed automatically:

  • Category:Generated code — always
  • Category:Untested code — when the status is untested
  • Category:Tested code — otherwise, including failed code

If you want failed code separated out, add a Known broken code branch to the category switch.

Notes

  • Requires ParserFunctions for #switch and #if. lc is core. Both are present on this wiki.
  • The generated disclaimer is shown only when the code is untested or partial. Once someone has actually run it — even if it failed — the human verdict is the more useful warning, so the boilerplate is dropped. This means a shorthand tested=[[User:…]] (an unrecognised status) also suppresses it, since that value is read as the tester's name.
  • Transclude ({{Generated code|...}}) rather than substitute, so a fix here updates every page at once. Use {{subst:Generated code|...}} only for archived pages that must survive later edits to this template.
  • To change the look, edit the colours and sizes in the div's style attribute; nothing else depends on them.