mNo edit summary |
mNo edit summary |
||
Line 23: | Line 23: | ||
--common strings |
--common strings |
||
cstr = { |
cstr = { |
||
− | file = " |
+ | file = "File:", --[[File: ...]] |
+ | media = "Media:", |
||
empty = "", |
empty = "", |
||
the = "The", |
the = "The", |
Revision as of 20:37, 1 December 2021
List of functions
- Note that the
...
indicates dynamic count of parameters. I.e. the function accepts an indefinite number of parameters.
clro(text[, true]) - clr function with preset colouring scheme order. Fucntion has optional parameter for resetting the colouring order back to start: clro(text[, true]) bclr(color, text) - clr function with additional bolding: '''clr(color, text)''' iclr(color, text) - clr functionwith additional italic style: ''clr(color, text)'' quote(text, author) - Flourished text, usually used at the end of description of Perk/Offering/Item/Add-on link(text, ...) - Wraps the text with brackets making it as a link: [[text|additional parameter]] templateLink(text) - Wraps the text with brackets making it as a template: {{text}} quotes(text) - Wraps the text with quotes: "text" center(text) - Wraps the text with center html tags: <center>text</center> list(...) - Makes list from individual parameters file(text, ...) - Wraps the text with link brackets and adds "File:" prefix to the name: [[File:text|additional parameter1|additional parameter2]] brackets(text) - Wraps the text with basic brackets: (text) b(text) - Boldes the text: '''text''' i(text) - Italic style for text: ''text'' skip(text) - Wrapping the text into hashtags (which is used for making a phrase in dynamic string. I.e. multiple words encapsulated in hashtags will behave as a single word): #text# note(text) - Wrapping text with span styling the text as a note. Mainly used as a small text for Notice feature. join(...) - Concatenates passed parameters with separator that is either passed as last parameter, or if passed table second parameter is used as spearator or can be skipped at all to use default ", " separator: join("hello", "creepy", "world", " - ") => "hello - creepy - world"
the(alter, spaceless) - writes the article before a subject. first parameter should be always passed in order to keep compatibility for non English wikis so the logic can be amended to language's needs to modify the article: the(killer) article(alter, spaceless) - general version of the() function, currently the major use is for indefinite articles ptb(content, title, patch) - wraps the content with PTB box with optional title above the box. Can be automated with passing a patch
Functionsclr
quote
link, file
templateLink
quotes
center
list
brackets
b, i
join
the
ptb
|
*Most funtions are only emulated as they don't have a hook to be used directly from wiki. The purpose of these functions is mainly to ease the work with strings in LUA/Scribunto and keep better clarity in strings to see actual content with minimum of escaping characters, etc.
The above documentation is transcluded from Module:Strings/doc. (edit | history)
--DO NOT CHANGE
bar = "|" -- code for |
br = "<br>" --break
brnl = "<br>\n" --break new line
space = " "
dot = "."
comma = ", "
colon = ":"
bullet = "\n* " --deprecated, do not use!
nbullet = "*" --newBullet -> please use this version, the old will be removed eventually
dbullet = "\n** " --deprecated
ndbullet = "**"
nl = "\n" --new line
dnl = "\n\n" -- double new line
tnl = "\n\n\n" --tripple new line
nlp = "\n<p>" --new line paragraph
pg = "<p>" --paragraph
ntl = "|-" -- new table line
hl = "! " -- header line
tl = "|" --table line
dtl = "||" -- double table line
--common strings
cstr = {
file = "File:", --[[File: ...]]
media = "Media:",
empty = "",
the = "The",
contact = "Please Contact [[User:Jouki|Jouki]]",
--File Formats
ogg = 'ogg',
mp3 = 'mp3',
mp4 = 'mp4',
jpg = 'jpg',
jpeg= 'jpeg',
png = 'png',
gif = 'gif',
}
--iconLinkStrings
ils = {
-- Interaction
baseHooks = "Basement Hooks",
blastMines = "Blast Mines",
bWall = "Breakable Wall",
bWalls = "Breakable Walls",
boonTotem = "Boon Totem",
chest = "Chest",
chests = "Chests",
dullTotem = "Dull Totem",
eMedkit = "Emergency Med-Kit",
exitGate = "Exit Gate",
exitGates = "Exit Gates",
eGateSwitches = "Exit Gate Switches",
failedSChecks = "Failed Skill Checks",
firecrackers = "Firecrackers",
flashlights = "Flashlights",
flashbangs = "Flashbangs",
flashGrenade = "Flash Grenade",
gen = "Generator",
gens = "Generators",
gSkillCheck = "Good Skill Check",
gSkillChecks = "Good Skill Checks",
hatch = "Hatch",
hexTotem = "Hex Totem",
hexTotems = "Hex Totems",
hook = "Hook",
hooks = "Hooks",
item = "Item",
items = "Items",
locker = "Locker",
lockers = "Lockers",
map = "Map",
medkit = "Med-Kit",
medkits = "Med-Kits",
pallet = "Pallet",
pallets = "Pallets",
survivor = "Survivor",
survivors = "Survivors",
skillCheck = "Skill Check",
skillChecks = "Skill Checks",
toolbox = "Toolbox",
totem = "Totem",
totems = "Totems",
greatSCheck = "Great Skill Check",
greatSChecks = "Great Skill Checks",
window = "Window",
windows = "Windows",
-- UI (Status Effects, Auras)
adrenaline = "Adrenaline",
aura = "Aura",
auras = "Auras",
bleeding = "Bleeding",
blindness = "Blindness",
bloodlust = "Bloodlust",
broken = "Broken",
cursed = "Cursed",
deepWound = "Deep Wound",
endurance = "Endurance",
exhausted = "Exhausted",
exhaustion = "Exhaustion",
exposed = "Exposed",
haemorrhage = "Haemorrhage",
haste = "Haste",
hindered = "Hindered",
incapacitated = "Incapacitated",
luck = "Luck",
mangled = "Mangled",
obsession = "Obsession",
oblivious = "Oblivious",
undetectable = "Undetectable",
-- Killers
killer = "Killer",
nightmare = "Nightmare",
-- Misc.
addon = "Add-on",
altruism = "Altruism",
basement = "Basement",
bloodpoints = "Bloodpoints",
crows = "Crows",
devious = "Deviousness",
dyingState = "Dying State",
entity = "Entity",
healthState = "Health State",
healthy = "Healthy",
hunter = "Hunter",
injuredState = "Injured State",
poolsBlood = "Pools of Blood",
scratchMarks = "Scratch Marks",
stillCrows = "Stillness Crows",
terrorRadius = "Terror Radius",
}
function clr(color, text)
local utils = require("Module:Utils")
return utils.clr(text, color)
end
function bclr(color, text)
local utils = require("Module:Utils")
return b(utils.clr(text, color))
end
function iclr(color, text)
local utils = require("Module:Utils")
return i(utils.clr(text, color))
end
function link(text)
return '[[' .. text .. ']]'
end
function brackets(text)
return '(' .. text .. ')'
end
--bold function
function b(text)
return "'''" .. text .. "'''"
end
--italic function
function i(text)
return "''" .. text .. "''"
end
function the(alter)
return (type(alter) == "table" and alter.the) or alter or cstr.the
end