Module Util

wikiggutil helper functions.

Functions

TEXToPNGPath (path) Convert .TEX path to wiki-compatible .PNG path.

String Utils

StrInsertAt (str, istr, idx) Insert into string.
StrRemapLinks (str, remap_table) Replace parts of string with wiki links.
StrRemove (str, idx_start, idx_end) Remove substring from string.


Functions

TEXToPNGPath (path)
Convert .TEX path to wiki-compatible .PNG path.

Replaces slashes (/) with underscores (_), and change .TEX to .PNG.

e.g: "images/ui_ftf_weather_icons1/icon_weather_zuccotraps.tex" will turn into "images_ui_ftf_weather_icons1_icon_weather_zuccotraps.png"

Parameters:

  • path string Original .TEX file path.

Returns:

    string Formatted .PNG path.

String Utils

StrInsertAt (str, istr, idx)
Insert into string.

Parameters:

  • str string Original string.
  • istr string String to insert into str.
  • idx number Insert position.

Returns:

    string str with istr inserted at idx.
StrRemapLinks (str, remap_table)
Replace parts of string with wiki links.

Turns every occurrence of "abc" in provided string into a Wikitext link ([[]]).

Parameters:

Returns:

    string New string.
StrRemove (str, idx_start, idx_end)
Remove substring from string.

Parameters:

  • str string Original string.
  • idx_start number Begin index.
  • idx_end number End index.

Returns:

    string New string with [idx_start...idx_end] removed.
generated by LDoc 1.5.0 Last updated 1980-01-01 00:00:00