Module WikitextBasic
Basic Wikitext generators.
An exclusive small subset of the Wikitext module, intended to be imported by other wikiggutil modules to avoid infinite require loops
Functions
| AttributesToString (attr_table) | Generate Wikitext attribute list. |
| File (filename[, size[, constrain_height]]) | Generate Wikitext file embed. |
| FileLink (str[, dest], filename[, size]) | Generate Wikitext file embed (with link). |
| Link (str[, dest]) | Generate Wikitext link. |
Functions
- AttributesToString (attr_table)
-
Generate Wikitext attribute list.
Parameters:
- attr_table {[string]=string,...} Key-value table mapping attributes to values.
Returns:
-
string
Whitespace-separated string of attribute=value.
Usage:
WikitextBasic.AttributesToString({rowspan=rowspan_amount, style="text-align:center;"})
- File (filename[, size[, constrain_height]])
-
Generate Wikitext file embed.
Parameters:
- filename
string
File name (
File:filename). - size number Image size (in pixels). (optional)
- constrain_height bool Constrain image height (see the MediaWiki Images page for more details). (optional)
Returns:
-
string
Wikitext file embed.
- filename
string
File name (
- FileLink (str[, dest], filename[, size])
-
Generate Wikitext file embed (with link).
Gives a file embed that redirects to a specified page when clicked.
Note: This is an image that acts as a link, not the same as embedding a File next to a Link.
stranddestare passed to Link.Parameters:
- str string Display text.
- dest string Destination wiki page. (optional)
- filename
string
File name (
File:filename). - size number Image size (in pixels). (optional)
Returns:
-
string
Wikitext file embed (with
linkattribute).Usage:
... local name = def.pretty and def.pretty.name or def.name local icon = TEXToPNGPath(def.icon or "") local amount = reward.count local name_str = FileLink(name, nil, icon, Const.ICON_SIZE_SMALL)
- Link (str[, dest])
-
Generate Wikitext link.
Parameters:
Returns:
-
string
Wikitext link.