Module:Strings

From Dead by Daylight Wiki
Jump to navigation Jump to search
Template-info.svg Documentation

List of functions

  • Note that the ... indicates dynamic count of parameters. I.e. the function accepts an indefinite number of parameters.
clr(color, text) - Colours the text with the color (that are stored in Module:Utils, under clr function)

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



To see whole documentation Expand the view

Functions

clr

  • clr(color, text) - Colours the text with the color (that are stored in Module:Utils, under clr function)
  • bclr(color, text) - Variation of clr function with additional wrap of bold style
  • iclr(color, text) - Variation of clr function with additional wrap of bold style
    • color - [Mandatory] used color. Their variations can be found at Clr Documentation. Colors are added in
      clr()
      function
      .
    • text - [Mandatory] text being coloured
Example(s)
clr("Chartreuse", "Coloured text with Chartreuse color")
{{#Invoke:Utils|clr|Chartreuse|Coloured text with Chartreuse color}}
Coloured text with Chartreuse color
bclr(6, "Coloured text with Teachable color")
'''{{#Invoke:Utils|clr|6|Coloured text with Teachable color with bold style}}'''
Coloured text with Teachable color with bold style
iclr("Red", "Coloured text with red color")
''{{#Invoke:Utils|clr|Red|Coloured text with red color with italic style}}''
Coloured text with red color with italic style


quote

  • quote(text, author) - Adjusts the text with the color according colour and applies italic styling
    • text - [Mandatory] quoted text
    • author - [Optional] used if the quote has its author
Example(s)
quote("Those who want to, look for a way, those who don't, look for a reason", "Jan Werich")
''{{#Invoke:Utils|clr|9|Those who want to, look for a way, those who don't, look for a reason — Jan Werich}}''
Those who want to, look for a way, those who don't, look for a reason — Jan Werich
quote("I got a present fo ya'")
''{{#Invoke:Utils|clr|9|I've got a present for ya'}}''
I've got a present for ya'


link, file

  • link(text, ...) - Wraps the text into brackets making a link from text. Can be passed additional parameter
  • file(text, ...) - Variation of link function with addition of
    File:
    • text - [Mandatory] Link redirecting to its destination
    • ... - [Optional] Used for renaming the link
Example(s)
link("Killers")
[[Killers]]
Killers
link("Left Behind (DLC)", "Left behind")
[[Left Behind (DLC)|Left behind]]
Left behind
file("BloodpointsIcon2.png", "56px", "link=")
[[File:BloodpointsIcon2.png|56px|link=]]
IconCurrency bloodpoints.png


templateLink

  • templateLink(text) - Wraps the text into brackets making a template name from text. (It shouldn't be used, unless it's necessary, since we try to minmise using templates)
    • text - [Mandatory] Link redirecting to its destination
Example(s)
templateLink("Patch 1.0.1a")
{{Patch 1.0.1a}}
CONTENT
  • Added art book for owners of the Deluxe Edition

quotes

  • templateLink(text) - Wraps the text with quotes. Function is mainly used for cases when one of the quotes would be sole string in combination with other string concatenations.
    • text - [Mandatory] text to be wrapped with quotes
Example(s)
quotes("Accidentally")
"Accidentally"
"Accidentally"
quotes("Accidentally" .. string.done)
"\"Accidentally" .. strings.done .. "\""
"Accidentally done"

center

  • center(text) - Wraps the text with
    <center>
    HTML tag. Function is mainly used for cases when one of the quotes would be sole string in combination with other string concatenations.
    • text - [Mandatory] text to be centered
Example(s)
center("Centered text")
<center>Centered text</center>
Centered text

list

  • list(...) - Creates a list (* notation) from individual passed parameters. It is strongly recommended to use this function for making any list.
    • ... - [Mandatory] String(s) that are to be formatted into a list
Example(s)
list("First item", "Second item", "Third item")
*First item *Second item *Third item
  • First item
  • Second item
  • Third item
list("Sole point")
*Sole point
  • Sole point

brackets

  • file(text) - Wraps the text with simple brackets. Function has the same purpose as .
    • ... - [Mandatory] String(s) that are to be concatenated after filename
Example(s)
brackets("Wrapped text")
(Wrapped text)
(Wrapped text)
brackets("This effect is applied to all " .. strings.survivors)
"(This effect is applied to all " .. string.survivors .. ")"
(This effect is applied to all survivors)


b, i

  • b(text) - Wraps the text with a triple of apostrophes making text bold.
  • i(text) - Wraps the text with a pair of apostrophes making text with italic style.
    • text - [Mandatory] String that are to be wrapped with apostrophes.
Example(s)
b("Bold text")
'''Bold text'''
Bold text
i("Italic text")
''Italic text''
Italic text

join

  • join(...) - Concatenates passed parameters with separator that is either passed as last parameter, or if passed table the second parameter is used as spearator or can be skipped at all to use default ", " separator.
    • ..., sep - [Mandatory] Strings that are to be joined together by separator (string), being last parameter
    • {...}, sep - [Mandatory] Strings encapsulated as a table that are to be joined together by separator (string), being second parameter (table of strings is considered as a one parameter)
Example(s)
join("Hello", "cruel", "world.", " - ")
Hello - cruel - world.
Hello - cruel - world.
join({"Hello", "cruel", "world."}, ";")
Hello;cruel;world.
Hello;cruel;world.
join({"First action", "Second action", "Thrid action"})
Hello, cruel, world.
First action, Second action, Thrid action.

the

  • the(alter, spaceless) - Function for evaluating the article before the object it is inserted in front of. This function is mainly used on non-English wikis as their rules for articles differ.
    • alter - [Mandatory/Optional] Object with the help of which the article is evaluated.
    • spaceless - [Optional] Flag indicating whether to append a space after the article.
Example(s)
the(killer) The Trapper

ptb

  • ptb(content, title, patch) - Wraps the content into a stylised box indicating that the content inside contains changes that are not on live server, resp. are on PTB.
    • content - [Mandatory] String/Content to be wrapped
    • title - [Optional] If title is passed it will appear above the box describing further details about the changed content
    • patch - [Optional] If patch parameter is passed the PTB Box will evaluate whether the patch is live. If so it won't show the box at all, otherwise the PTB Box will be rendered as usual. Patch list is stored in Module:Datatable
Example(s)
ptb("Changed values from upcoming patch")
{{ptb|Changed values from upcoming patch}}
Changed values from upcoming patch
ptb("Changed values from upcoming patch", "This change is aprt of patch x.y.z")
{{ptb|Changed values from upcoming patch|This change is aprt of patch x.y.z}}
This change is aprt of patch x.y.z
Changed values from upcoming patch
ptb("Changed values from upcoming patch", "This change is aprt of patch x.y.z", "6.0.0")
{{ptb|Changed values from upcoming patch|This change is aprt of patch x.y.z|6.0.0}}
Changed values from upcoming patch
ptb("Changed values from upcoming patch", "This change is aprt of patch x.y.z", "99.99.99")
{{ptb|Changed values from upcoming patch|This change is aprt of patch x.y.z|99.99.99}}
This change is aprt of patch x.y.z
Changed values from upcoming patch




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


--DO NOT CHANGE
require("Module:Extensions")
bar = "&#124;" -- code for |
br = "<br>" --break
brnl = "<br>\n" --break new line
dbr = "<br><br>" -- double break
space = " "
nbsp = " " -- Non Breakable SPace
nbspC = "&nbsp;" -- Non Breakable SPace Code
hiddenChar = "‎" --hidden char that won't get rendered but behaves like the one
dot = "."
comma = ", "
colon = ":"
semi = ";"
dash = "-"
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
dhl = "!!" -- double header line
tl = "|" --table line
dtl = "||" -- double table line

strVars = {
	bar = bar, br = br, brnl = brnl, dbr = dbr, space = space, nbsp = nbsp, nbspC = nbspC, hiddenChar = hiddenChar, dot = dot, comma = comma, colon = colon, semi = semi, dash = dash, bullet = bullet, nbullet = nbullet, dbullet = dbullet, ndbullet = ndbullet, nl = nl, dnl = dnl, tnl = tnl, nlp = nlp, pg = pg, ntl = ntl, hl = hl, dhl = dhl, tl = tl, dtl = dtl, tag = tag, effects = effects
}

--TRANSLATE PART--
descStrings = {
	statusEffect = "Status Effect",
	statusEffects = "Status Effects",
	--statesOrder = "#1# #2#",
	andString = "and",
}
--TRANSLATE PART END--

--common strings
cstr = {
	category = "Category:", --[[Category: ...]]
	file = "File:", --[[File: ...]]
	media = "Media:",
	empty = "",
	the = "The",
	contact = space .. "Please contact [[User:Jouki|Jouki]]",
	gameName = "Dead by Daylight",
	
	frameless = "frameless",
	left = "left",
	center = "center",
	right = "right",

	--File Formats
	ogg = 'ogg',
	mp3 = 'mp3',
	mp4 = 'mp4',
	jpg = 'jpg',
	jpeg= 'jpeg',
	png = 'png',
	gif = 'gif',
}

types = {
	number = "number",
	string = "string",
	table = "table"
}

multinames = { --values in brackets in case of multiname
	achievement = "achievement",
	dlc = "DLC",
	killer = "killer",
	map = "map",
	realm = "realm",
	perk = "perk",
	power = "power",
	survivor = "survivor"
}

--iconLinkStrings
ils = {
	-- Interaction
	basementHooks	  = "Basement Hooks",
	blastMine         = "Blast Mine",
	blastMines		  = "Blast Mines",
	breakableWall	  = "Breakable Wall",
	breakableWalls	  = "Breakable Walls",
	boonTotem		  = "Boon Totem",
	boonTotems        = "Boon Totems",
	cageOfCorruption  = "Cage of Corruption",
	cagesOfCorruption = "Cages of Corruption",
	cageOfAtonement   = "Cage of Atonement",
	cagesOfAtonement  = "Cages of Atonement",
	chest			  = "Chest",
	chests			  = "Chests",
	dullTotem		  = "Dull Totem",
	dullTotems        = "Dull Totems",
	exitGate		  = "Exit Gate",
	exitGates		  = "Exit Gates",
	exitGateSwitch    = "Exit Gate Switch",
	exitGateSwitches  = "Exit Gate Switches",
	failedSkillCheck  = "Failed Skill Check",
	failedSkillChecks = "Failed Skill Checks",
	firecracker       = "Firecracker",
	firecrackers	  = "Firecrackers",
	flashlight        = "Flashlight",
	flashlights		  = "Flashlights",
	flashbang         = "Flashbang",
	flashbangs		  = "Flashbangs",
	flashGrenade	  = "Flash Grenade",
	flashGrenades     = "Flash Grenades",
	generator		  = "Generator",
	generators		  = "Generators",
	goodSkillCheck	  = "Good Skill Check",
	goodSkillChecks	  = "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",
	maps			  = "Maps",
	medKit            = "Med-Kit",
	medKits			  = "Med-Kits",
	pallet			  = "Pallet",
	pallets			  = "Pallets",
	survivor		  = "Survivor",
	survivors		  = "Survivors",
	skillCheck		  = "Skill Check",
	skillChecks		  = "Skill Checks",
	toolbox           = "Toolbox",
	toolboxes		  = "Toolboxes",
	totem			  = "Totem",
	totems			  = "Totems",
	greatSkillCheck   = "Great Skill Check",
	greatSkillChecks  = "Great Skill Checks",
	window			  = "Window",
	windows			  = "Windows",
	
	-- UI (Status Effects, Auras)
	adrenaline		= "Adrenaline",
	aura			= "Aura",
	auras			= "Auras",
	bleeding		= "Bleeding",
	blessed         = "Blessed",
	blindness		= "Blindness",
	bloodlust		= "Bloodlust",
	broken			= "Broken",
	chance          = "Chance",
	cursed			= "Cursed",
	deafened        = "Deafened",
	deepWound		= "Deep Wound",
	efficiency      = "Efficiency",
	endurance		= "Endurance",
	enduranceKiller = "Endurance (Killer)",
	enduranceSurvivor = "Endurance (Survivor)",
	exhausted		= "Exhausted",
	exhaustion		= "Exhaustion",
	exposed			= "Exposed",
	haemorrhage		= "Haemorrhage",
	haste			= "Haste",
	hearing         = "Hearing",
	hindered		= "Hindered",
	incapacitated	= "Incapacitated",
	luck			= "Luck",
	madness         = "Madness",
	mangled			= "Mangled",
	obsession		= "Obsession",
	oblivious		= "Oblivious",
	revealed        = "Revealed",
	sleepPenalty    = "Sleep Penalty",
	undetectable	= "Undetectable",
	vision          = "Vision",
	
	-- Killers
	killer			= "Killer",
	nightmare		= "Nightmare",
	
	-- Misc.
	addon			= "Add-on",
	addons			= "Add-ons",
	altruism		= "Altruism",
	basement		= "Basement",
	bloodpoints		= "Bloodpoints",
	bpWhite         = "Bloodpoints white",
	boldness        = "Boldness",
	brutality       = "Brutality",
	crow			= "Crow",
	crows			= "Crows",
	deviousness		= "Deviousness",
	dyingState		= "Dying State",
	entity			= "Entity",
	healthState		= "Health State",
	healthy			= "Healthy",
	hunter			= "Hunter",
	injuredState    = "Injured State",
	objectives      = "Objectives",
	offering		= "Offering",
	offerings		= "Offerings",
	poolsOfBlood	= "Pools of Blood",
	sacrifice       = "Sacrifice",
	scratchMarks	= "Scratch Marks",
	idleCrows		= "Idle Crows",
	survival        = "Survival",
	terrorRadius	= "Terror Radius",
}

specialWords = {
	dot = "dot"
}

function word(wrd)
	return " {<" .. specialWords[wrd] .. ">}" --" {<dot>}"
end

function iconLink(icon, link, text)
	local utils = require("Module:Utils")
	return utils.IconLink(icon, link, text)
end

function icon(icon)
	local utils = require("Module:Utils")
	return utils.getIcon(icon)
end

function img(iconName, ...)
	return file(icon(iconName), ...)
end

function aImg(iconType, iconName, iconSize, params)
	local utils = require("Module:Utils")
	return utils.assembleImage(iconType, iconName, iconSize, params)
end

function clr(color, text)
	local utils = require("Module:Utils")
	return utils.clr(color, text)
end

function clro(text, reset)
	local utils = require("Module:Utils")
	return utils.clro(text, reset)
end

function clror(text)
	return clro(text, true)
end

function bclr(color, text)
	--local utils = require("Module:Utils")
	return b(clr(color, text))
end

function iclr(color, text)
	--local utils = require("Module:Utils")
	return i(clr(color, text))
end

function biclr(color, text) return ibclr(color, text) end
function ibclr(color, text)
	return i(b(clr(color, text)))
end

function tooltip(text, tooltip, iconless, bordeless)
	local utils = require("Module:Utils")
	return utils.tooltip(text, tooltip, iconless, bordeless)
end

function quote(text, author)
	local utils = require("Module:Utils")
	author = author or utils.resolveParameter(text, 2, true)
	text = utils.resolveParameter(text, 1) or cstr.empty
	return i(clr(9, '"' .. text .. ((author and '" — ' .. author) or '"')))
end

function states(...)
	local utils = require("Module:Utils")
	local states = {...}
	local suffix = (#states > 1 and descStrings.statusEffects) or descStrings.statusEffect
	local result = utils.getDynamicString(
		{
			skip(table.join(states, {comma, ((#states > 2 and comma) or cstr.empty) .. space .. descStrings.andString .. space}, {"ibil"})),
			skip(b(suffix))
		}
		, descStrings.statesOrder)
	return result
end

--function p.effects(_loType, loName, ...) effects(_loType, loName, ...) end
function effects(_loType, loName, ...) --this function should be called only if the loadout module is loaded
	local utils = require("Module:Utils")
	local effectsList = {...}
	local suffix = (#effectsList > 1 and descStrings.statusEffects) or descStrings.statusEffect
	local postprocessedStates = {}
	local loM = require("Module:Loadout" .. utils.lang())
	local varM = mw.loadData("Module:Datatable/Various" .. utils.lang())
	local lo = loM["get" .. utils.firstLetterUpper(_loType or cstr.empty) .. "ByName"] and loM["get" .. utils.firstLetterUpper(_loType) .. "ByName"](loName, false)
	local loCharType = lo and ((lo.charType == 'S' or lo.survivor) and ils.survivor) or ((lo.charType == 'K' or lo.killer) and ils.killer)
	for _, effect in pairs(effectsList) do
		local effObj = varM.effects[effect] or varM.effects[effect .. space .. brackets(loCharType)] or false
		local effectObjName = (varM.effects[effect] and effect) or (varM.effects[effect .. space .. brackets(loCharType)] and effect .. space .. brackets(loCharType))
		local displayName = effObj and effObj.displayName or effect
		local effectVarName = string.lower(utils.firstLetterLower(utils.capitalizeName(displayName)))
		local effectVarTechName = effObj and effObj.techName and string.lower(utils.firstLetterLower(utils.capitalizeName(effObj.techName))) or cstr.empty
		local durationVariableName = "duration" .. effect --this is for hindered and similar effects that has its strnegth in "hindered" variable and its duration is stored in "durationHindered" variable
		local durationValue = lo and (lo[durationVariableName] or lo[effectVarName] or (effObj and lo[effectVarTechName])) or -1
		local durationSplit
		if type(durationValue) == types.string then
			durationSplit = string.split(durationValue, space)
		end
		durationValue = tonumber(durationSplit and (durationSplit[2] ~= '%') and durationSplit[1] or durationValue) or -1
		--[[
		lg("LO Name: " .. (lo and lo.name or "NaN"))
		lg("raw effect:" .. effect)
		lg("effectVarName: " .. effectVarName)
		lg("effectVarTechName: " .. effectVarTechName)
		lg("durationValue: " .. durationValue)
		]]
		local debugInfoObj = (effectObjName == nil and {loCharType = (loCharType or "NULL"), loName = (loName or "NULL"), effect = (effect or "NULL"), effectWithCharType = (effect or "NULL") .. space .. brackets((loCharType or "NULL"))})
		table.add(postprocessedStates, i(b(link(displayName))) .. aImg("effect", effectObjName, 48, {il = true, duration = durationValue, debugInfo = debugInfoObj}))
	end
	local result = utils.getDynamicString(
		{
			skip(table.join(postprocessedStates, {comma, ((#postprocessedStates > 2 and comma) or cstr.empty) .. space .. descStrings.andString .. space})),
			skip(b(suffix))
		}
		, descStrings.statesOrder)
	return result
end

function ibil(ilsString) --i + b + iconLink
	local utils = require("Module:Utils")
	return i(b(utils.IconLink(ilsString)))
end

function link(text, ...)
	local parameters = (#{...} > 0 and tl .. table.concat({...}, tl)) or cstr.empty --join table with | so we get |param1|param2|param3|...
	return '[[' .. text .. parameters ..']]'
end

function templateLink(text)
	return '{{' .. (text or "Error") .. '}}'
end

function quotes(text)
	return '"' .. (text or "Error") .. '"'
end

function center(text)
	return '<center>' .. (text or "Error") .. '</center>' 
end

function includeonly(text)
	return '<includeonly>' .. (text or "Error") .. '</includeonly>' 
end

function noinclude(text)
	return '<noinclude>' .. (text or "Error") .. '</noinclude>' 
end

function list(...)
	local result = cstr.empty
	local items = {...}
	for _, row in ipairs(items) do
		result = result .. nbullet .. row .. nl
	end
	return nl .. result .. nl
end

function file(filename, ...)
	local parameters = (#{...} > 0 and tl .. table.concat({...}, tl)) or cstr.empty --join table with | so we get |param1|param2|param3|...
	return link(cstr.file .. filename .. parameters)
end

function media(filename, ...)
	local parameters = (#{...} > 0 and tl .. table.concat({...}, tl)) or cstr.empty --join table with | so we get |param1|param2|param3|...
	return link(cstr.media .. filename .. parameters)
end

function category(...)
	local result = {}
	for _, cat in ipairs({...}) do
		table.insert(result, link(cstr.category .. cat))
	end
	if #result > 0 then
		return table.concat(result, nl) --nl maybe needs to be replaced with cstr.empty if nl creates new rows
	else
		return link(cstr.category .. "Category-Module-Error")
	end
end

function brackets(text)
	return '(' .. (text or "Error") .. ')'
end 

function tag(tagName, tagContent, closeTag)
	closeTag = closeTag or tagContent == true
	tagContent = (tagContent == true or tagContent == false or tagContent == nil) and cstr.empty or tagContent
	return '<' .. (closeTag and '/' or cstr.empty) .. tagName .. space .. tagContent .. '>'
end

--bold function
function b(text)
	text = stringsObjs.resolveParam(text, 1, true)
	return "<b>" .. (text or "Error") .. "</b>"
end

--italic function
function i(text)
	return "<i>" .. (text or "Error") .. "</i>"
end

function skip(text)
	return "#s#" .. (text or "Error") .. "#/s#"
end

function big(text)
	return '<big>' .. (text or "Error") .. '</big>'
end

function small(text)
	return '<small>' .. (text or "Error") .. '</small>'
end

function note(text)
	return '<span class = "noticeText">' .. (text or "Error") .. '</span>'
end

function join(...)
	require("Module:Extensions")
	return table.join(...)
end

function the(alter, spaceless)
	local langs = require("Module:Languages")
	return langs.evaluateArticle(alter, false)
	--return (langs.nonEn() and (langs.evaluateArticle(alter))) or cstr.the .. ((not langs.nonEn() and not spaceless and space) or cstr.empty)
end

function article(obj, indefinite)
	local langs = require("Module:Languages")
	return langs.evaluateArticle(obj, indefinite)
end

function ptb(content, title, patch)
	local utils = require("Module:Utils")
	return utils.ptb(content, title, patch)
end

function deletedBox(content, title, patch)
	local utils = require("Module:Utils")
	return utils.deletedBox(content, title, patch)
end

--Syntax Highlight
function sh(value, lang, inline)
	local frame = mw.getCurrentFrame()
	local shArgs = {}
	shArgs.lang = ((lang ~= cstr.empty and lang) or "lua")
	shArgs.inline = (inline == true or inline == nil) or nil --true value is just a mockup for argument being present, regardless of actual value. false => will still show inline
	return b(frame:extensionTag{ name = 'syntaxhighlight', content = value, args = shArgs })
end


--table line => creates a basic table line so it can be easily stacked
function tLine(attrs, ...)
	local values = (type(...) == "string" and {...}) or ...
	local result = cstr.empty
	local separator = (values[#values] == hl and table.remove(values)) or tl --if the last item is header separator then set it to var
	local multiLine = false --if the cell value has multiple lines then we can't use double separator such as ||
	--if separator == hl then table.remove(values) end --if the last item was a separator, then remove it from the list. It's not needed anymore
	result = result .. ntl .. nl .. separator .. ((attrs and space .. attrs .. space .. tl) or cstr.empty) .. space .. table.remove(values, 1)
	for _, value in ipairs(values) do
		if string.find(value, nl) then
			multiLine = true
			break
		end
	end
	for _, value in ipairs(values) do
		result = result .. (multiLine and (nl .. separator) or (space .. separator .. separator)) .. space .. value
	end
	return result .. nl
end

--table header line => same as table line, just for header version
function thLine(attrs, ...)
	local values = {...}
	table.insert(values, hl)
	return tLine(attrs, values)
end

function class(...)
	local values = {...}
	return (#values and 'class = ' .. quotes(join(values, space))) or cstr.empty
end

function style(...)
	local values = {...}
	return (#values and 'style = ' .. quotes(join(values, semi))) or cstr.empty
end

function colspan(value) return ' colspan = ' .. tonumber(value) .. space end
function rowspan(value) return ' rowspan = ' .. tonumber(value) .. space end

function span(content, ...)
	local classes = class(...)
	return "<span " .. classes .. ">" .. content .. "</span>"
end

function div(content, ...)
	local classes = class(...)
	return "<div " .. classes .. ">" .. content .. "</div>"
end
-----------------------------
--     Debug Functions     --
-----------------------------

--Debug Log
function lg(obj)
	mw.log(obj)
end

--Dump object
function dmp(obj)
	mw.log(mw.dumpObject(obj))
end

--raw Dump
function rdmp(obj)
	return mw.dumpObject(obj)
end

--------------------------------
--     External functions     --
--------------------------------
stringsObjs = {}

--temporary - may be moved to Utils
function stringsObjs.resolveParam(param, index, canBeNil)
	local retArg = nil
	if type(param) == types.table then
		if param.args then
			if index then
				if index == 0 then
					retArg = param.args
				else
					retArg = param.args[index]
					if retArg == nil and not canBeNil then
						return stringsObjs.getPageName()
					else
						return retArg
					end
				end
			else
				if not canBeNil then
					return stringsObjs.getPageName()
				else
					return nil
				end
			end
		else
			return param
		end
	elseif param ~= nil then
		return param
	elseif not canBeNil then
		return stringsObjs.getPageName()
	else
		return nil
	end
end

function stringsObjs.getPageName()
	local pageName = mw.title.getCurrentTitle().text
		local pageParts = string.split(pageName, '/') -- remove page suffixes such as language codes
		if #pageParts > 1 then
			_unofficialLang = pageParts[#pageParts]
			return pageParts[#pageParts - 1] --take second to last part of page name
		end
		return pageParts[1]  --if there is no other part than the name itself
end

stringsObjs.bar = bar
stringsObjs.br = br
stringsObjs.brnl = brnl
stringsObjs.space = space
stringsObjs.nbsp = nbsp
stringsObjs.nbspC = nbspC
stringsObjs.hiddenChar = hiddenChar
stringsObjs.dot = dot
stringsObjs.comma = comma
stringsObjs.colon = colon
stringsObjs.semi = semi
stringsObjs.dash = dash
stringsObjs.bullet = bullet
stringsObjs.nbullet = nbullet
stringsObjs.dbullet = dbullet
stringsObjs.ndbullet = ndbullet
stringsObjs.nl = nl
stringsObjs.dnl = dnl
stringsObjs.tnl = tnl
stringsObjs.nlp = nlp
stringsObjs.pg = pg
stringsObjs.ntl = ntl
stringsObjs.hl = hl
stringsObjs.dhl = dhl
stringsObjs.tl = tl
stringsObjs.dtl = dtl

stringsObjs.cstr = cstr
stringsObjs.types = types
stringsObjs.ils = ils
function stringsObjs.iconLink(link, icon, text) return iconLink(link, icon, text) end
function stringsObjs.icon(icon) return icon(icon) end
function stringsObjs.img(iconName, ...) return img(iconName, ...) end
function stringsObjs.aImg(iconType, iconName, iconSize, params) return aImg(iconType, iconName, iconSize, params) end
function stringsObjs.clr(color, text) return clr(color, text) end
function stringsObjs.clro(text, reset) return clro(text, reset) end
function stringsObjs.clror(text) return clror(text) end
function stringsObjs.biclr(color, text) return ibclr(color, text) end
function stringsObjs.ibclr(color, text) return ibclr(color, text) end
function stringsObjs.bclr(color, text) return bclr(color, text) end
function stringsObjs.iclr(color, text) return iclr(color, text) end
function stringsObjs.tooltip(text, tooltip, iconless) return tooltip(text, tooltip, iconless) end
function stringsObjs.quote(text, author) return quote(text, author) end
function stringsObjs.states(...) return states(...) end
function stringsObjs.effects(_loType, loName, ...) return effects(_loType, loName, ...) end
function stringsObjs.ibil(ilsString) return ibil(ilsString) end
function stringsObjs.link(text, ...) return link(text, ...) end
function stringsObjs.templateLink(text) return templateLink(text) end
function stringsObjs.quotes(text) return quotes(text) end
function stringsObjs.center(text) return center(text) end
function stringsObjs.includeonly(text) return includeonly(text) end
function stringsObjs.noinclude(text) return noinclude(text) end
function stringsObjs.list(...) return list(...) end
function stringsObjs.file(text, ...) return file(text, ...) end
function stringsObjs.media(filename, ...) return media(filename, ...) end
function stringsObjs.category(...) return category(...) end
function stringsObjs.brackets(text) return brackets(text) end
function stringsObjs.tag(tagName, tagContent, closeTag) return tag(tagName, tagContent, closeTag) end
function stringsObjs.b(text) return b(text) end
function stringsObjs.i(text) return i(text) end
function stringsObjs.skip(text) return skip(text) end
function stringsObjs.big(text) return big(text) end
function stringsObjs.small(text) return small(text) end
function stringsObjs.note(text) return note(text) end
function stringsObjs.join(...) return join(...) end
function stringsObjs.the(alter, spaceless) return the(alter, spaceless) end
function stringsObjs.article(obj, indefinite) return article(obj, indefinite) end
function stringsObjs.ptb(content, title, patch) return ptb(content, title, patch) end
function stringsObjs.deletedBox(content, title, patch) return deletedBox(content, title, patch) end
function stringsObjs.sh(value, lang, inline) return sh(value, lang, inline) end
function stringsObjs.tLine(attrs, ...) return tLine(attrs, ...) end
function stringsObjs.thLine(attrs, ...) return thLine(attrs, ...) end
function stringsObjs.class(...) return class(...) end
function stringsObjs.style(...) return style(...) end
function stringsObjs.colspan(value) return colspan(value) end
function stringsObjs.rowspan(value) return rowspan(value) end
function stringsObjs.span(content, ...) return span(content, ...) end
function stringsObjs.div(content, ...) return div(content, ...) end
return stringsObjs