Module:Template introspection: Difference between revisions

Ganaram inukshuk (talk | contribs)
m update todo (wrapper is alraedy made)
Ganaram inukshuk (talk | contribs)
normalize arg names to snake case
Line 71: Line 71:


function p._template_introspection(args)
function p._template_introspection(args)
local template_name = args["Template Name"]
local template_name = args["template_name"]


-- Get template wikitext
-- Get template wikitext
Line 96: Line 96:
-- Get template name, with namespace, and strip /doc if present
-- Get template name, with namespace, and strip /doc if present
args["Template Name"] = args["Template Name"] or mw.title.getCurrentTitle().prefixedText
args["template_name"] = args["template_name"] or mw.title.getCurrentTitle().prefixedText
args["Template Name"] = args["Template Name"]:gsub("/doc$", "")
args["template_name"] = args["template_name"]:gsub("/doc$", "")
return p._template_introspection(args)
return p._template_introspection(args)