Module:Utils

-- Config local QUEST_TYPES = {	main = {		title = "Main Job", pagename = "Cyberpunk 2077 Main Jobs", catname = "Cyberpunk 2077 main jobs", },	side = {		title = "Side Job", pagename = "Cyberpunk 2077 Side Jobs", catname = "Cyberpunk 2077 side jobs", },	gig = {		title = "Gig", pagename = "Cyberpunk 2077 Gigs", catname = "Cyberpunk 2077 gigs", },	nsh = {		title = "NCPD Scanner Hustle", pagename = "Cyberpunk 2077 NCPD Scanner Hustles", catname = "Cyberpunk 2077 NCPD scanner hustles", }, }

-- Code starts here local p = {}

-- get quest type docs function p.quest_type_docs(frame)

local result = '' for k, v in pairs(QUEST_TYPES) do result = result .. '* ' .. k .. ': ' .. v['title'] .. '\n' end return frame:preprocess(result) end

-- return current page basename function p.current_page_basename(frame)

-- get current subpage name local page_name = mw.title.getCurrentTitle.subpageText -- strip any disambiguation suffix local page_basename = mw.ustring.gsub(page_name, '%s%(.*', '')

-- done return page_basename

end

-- return canonical text for quest type function p.quest_type(frame) local quest_type = frame.args[1] -- get derived params local quest_type_name = QUEST_TYPES[quest_type]['title'] local quest_type_pagename = QUEST_TYPES[quest_type]['pagename']

local result =  .. quest_type_name ..  return frame:preprocess(result) end

--return canonical quest category function p.quest_category(frame) local quest_type = frame.args[1] -- get derived params local quest_type_catname = QUEST_TYPES[quest_type]['catname'] -- get basename local page_basename = p.current_page_basename(frame) local result = '' return frame:preprocess(result) end

return p