Module:Infobox Test: Difference between revisions

From Bibliotheca Anonoma
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
local p = {}
local p = {}
   
   
function p.run(frame)
function p.default(frame)
local capiunto = require 'capiunto'
local capiunto = require 'capiunto'
return capiunto.create( {
return capiunto.create( {
top = tostring(mw.title.getCurrentTitle()),
top = tostring(mw.title.getCurrentTitle()),
topStyle = 'background:#cfc;',
topStyle = 'background:#cfc;',
bottom = frame.args[1]; -- description
bottom = frame.args["description"]; -- description
} )
} )
:addImage(
:addImage(
-- featured image
string.format('[[File:%s|200px]]', frame.args["img_url"]), -- featured image
'[[File:' + frame.args[2] + '|200px]]',
frame.args["caption"] -- caption
-- caption
frame.args[3]
)
)
:addRow('URL', frame.args[4])
:addRow('URL', frame.args["url"])
:addRow('Project Status', frame.args[5])
:addRow('Project Status', frame.args["project_status"])
:addRow('Archiving Status', frame.args[6])
:addRow('Archiving Status', frame.args["archiving_status"])
:addRow('Project Source', frame.args[7])
:addRow('Project Source', frame.args["project_source"])
end
end


return p
return p

Latest revision as of 19:56, 8 January 2017

Documentation for this module may be created at Module:Infobox Test/doc

local p = {}
 
function p.default(frame)
	local capiunto = require 'capiunto'
	return capiunto.create( {
		top = tostring(mw.title.getCurrentTitle()),
		topStyle = 'background:#cfc;',
		bottom = frame.args["description"]; -- description
	} )
	:addImage(
		string.format('[[File:%s|200px]]', frame.args["img_url"]), -- featured image
		frame.args["caption"] -- caption
	)
	:addRow('URL', frame.args["url"])
	:addRow('Project Status', frame.args["project_status"])
	:addRow('Archiving Status', frame.args["archiving_status"])
	:addRow('Project Source', frame.args["project_source"])
end

return p