Jump to content

Module:Road data/browsetable: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Produces a table to contain the output of Module:Road data/browse
 
Fix bugs
Line 8: Line 8:
tbl:wikitext(content)
tbl:wikitext(content)


return frame:extensionTag{
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Module:Road data/browsetable/styles.css' }
name = 'templatestyles', args = { src = 'Module:Road data/browsetable/styles.css' }
} .. tostring(tbl)
} .. tostring(tbl)
end
end


function p.browsetable(args)
function p.browsetable(frame)
local args = getArgs(frame)
local args = getArgs(frame)



Revision as of 19:04, 26 July 2024

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

function p._browsetable(content)
	if not content then return nil end

	local tbl = mw.html.create('table'):addClass('browse-table')
	tbl:wikitext(content)

	return mw.getCurrentFrame():extensionTag{
		name = 'templatestyles', args = { src = 'Module:Road data/browsetable/styles.css' }
	} .. tostring(tbl)
end

function p.browsetable(frame)
	local args = getArgs(frame)

	return p._browsetable(args)
end

return p