Toggle menu
209
926
189
6.3K
Dovedale Railway Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Module documentation[view][edit][history][purge]
This documentation is transcluded from Module:DidYouKnow/doc. Changes can be proposed in the talk page.
Function list
L 4 — create_html
L 23 — p.main

local getArgs  = require( 'Module:Arguments' ).getArgs
local p = {}

local function create_html(column,row,fact)
	local card = mw.html.create("div")
	    :addClass("home-card home-card--col2 home-card--row3")
	    :addClass("home-card--col"..tostring(column))
	    :addClass("home-card--row"..tostring(row))
	    :tag("div")
	    :addClass("home-card__header")
	    :wikitext("Did you know")
	    :done()
	    :tag("div")
	    :addClass("home-card")
	    :addClass("home-card__label")
	    :css("border-width","0px")
	    :wikitext(fact)
	    :done()
	    :done()
	return tostring(card)
end

function p.main(frame)
	frame = frame
	local args = getArgs(frame)
	local facts = mw.loadJsonData("/facts.json").facts
	return create_html(args.column or 2, args.row or 3,args.fact or facts[math.random(1,#facts)])..frame:extensionTag{name="templatestyles", args={src="Module:Dimensions/styles.css"}}
end
return p
🍪 Yum Yum Yum! Cookies help us better deliver our services. By using our site, you agree to our use of cookies.