Module:Test: Difference between revisions
(Created page with "local p = {} function p.output(frame) -- The string you want to output local outputString = "Hello, World! {{pmid|19940465}}" return outputString end return p") |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
function p.output(frame) | function p.output(frame) | ||
-- | -- Define the template to be expanded | ||
local | local templateToExpand = { | ||
title = "pmid", | |||
args = { "19940465" } | |||
} | |||
-- Use frame:expandTemplate to process the template | |||
local expandedTemplate = frame:expandTemplate(templateToExpand) | |||
-- Concatenate the expanded template with your string | |||
local outputString = 'Hello, World! ' .. expandedTemplate | |||
return outputString | return outputString | ||
end | end | ||
return p | return p |
Latest revision as of 23:34, 20 February 2024
Documentation for this module may be created at Module:Test/doc
local p = {}
function p.output(frame)
-- Define the template to be expanded
local templateToExpand = {
title = "pmid",
args = { "19940465" }
}
-- Use frame:expandTemplate to process the template
local expandedTemplate = frame:expandTemplate(templateToExpand)
-- Concatenate the expanded template with your string
local outputString = 'Hello, World! ' .. expandedTemplate
return outputString
end
return p