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
.TEXto.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:
Returns:
-
string
strwithistrinserted atidx. - StrRemapLinks (str, remap_table)
-
Replace parts of string with wiki links.
Turns every occurrence of "abc" in provided string into a Wikitext link (
[[]]).Parameters:
- str string Original string.
- remap_table {{[string]=string,[string]=string},...} Indexed table in Const.MAP_LINKS format.
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.