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:

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.
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.

str and dest are 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 link attribute).

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:

  • str string Display text.
  • dest string Destination wiki page (same as str if unspecified). (optional)

Returns:

    string Wikitext link.
generated by LDoc 1.5.0 Last updated 1980-01-01 00:00:00