/tg/ Station 13 - Modules - TypesVar Details - Proc Details

autowiki

A representation of an automated wiki page.

Vars

pageThe page on the wiki to be replaced. This should never be a user-facing page, like "Guide to circuits". It should always be a template that only Autowiki should touch. For example: "Template:Autowiki/CircuitInfo".

Procs

escape_valueEscape a parameter such that it can be correctly put inside a wiki output
generateOverride and return the new text of the page. This proc can be impure, usually to call upload_file.
include_templateGenerates an auto formatted template user. Your autowiki should ideally be a lot of these. It lets wiki editors edit it much easier later, without having to enter repo. Parameters will be passed in by name. That means your template should expect something that looks like {{ Autowiki_Circuit|name=Combiner|description=This combines }} Lists, which must be array-like (no keys), will be turned into a flat list with their key and a number, such that list("food" = list("fruit", "candy")) -> food1=fruit|food2=candy
upload_iconTakes an icon and uploads it to Autowiki-name.png. Do your best to make sure this is unique, so it doesn't clash with other autowiki icons.

Var Details

page

The page on the wiki to be replaced. This should never be a user-facing page, like "Guide to circuits". It should always be a template that only Autowiki should touch. For example: "Template:Autowiki/CircuitInfo".

Proc Details

escape_value

Escape a parameter such that it can be correctly put inside a wiki output

generate

Override and return the new text of the page. This proc can be impure, usually to call upload_file.

include_template

Generates an auto formatted template user. Your autowiki should ideally be a lot of these. It lets wiki editors edit it much easier later, without having to enter repo. Parameters will be passed in by name. That means your template should expect something that looks like {{ Autowiki_Circuit|name=Combiner|description=This combines }} Lists, which must be array-like (no keys), will be turned into a flat list with their key and a number, such that list("food" = list("fruit", "candy")) -> food1=fruit|food2=candy

upload_icon

Takes an icon and uploads it to Autowiki-name.png. Do your best to make sure this is unique, so it doesn't clash with other autowiki icons.