Module:TNT: Difference between revisions

15 bytes removed ,  2 years ago
m
This module needs to be fixed. I mean, I saw an error.
m (Fix)
Tags: Reverted Mobile edit Mobile web edit
m (This module needs to be fixed. I mean, I saw an error.)
Tags: Manual revert Reverted
Line 20:
--
-- {{#invoke:TNT | msg
-- | I18n/Template:Graphs.tab <!-- https://commons.mirahezewikimedia.org/wiki/Data:I18n/Template:Graphs.tab -->
-- | source-table <!-- uses a translation message with id = "source-table" -->
-- | param1 }} <!-- optional parameter -->
Line 30:
--
-- {{#invoke:TNT | doc | Graph:Lines }}
-- uses https://commons.mirahezewikimedia.org/wiki/Data:Templatedata/Graph:Lines.tab
-- if the current page is Template:Graph:Lines/doc
--
Line 80:
end
 
-- Obsolete function that adds a 'commonsc:' prefix to the first param.
-- "Sandbox/Sample.tab" -> 'commonsc:Data:Sandbox/Sample.tab'
function p.link(frame)
return link(frame.args[1])
Line 157:
-- Give helpful error to thirdparties who try and copy this module.
if not mw.ext or not mw.ext.data or not mw.ext.data.get then
error('Missing JsonConfig extension; Cannot load https://commons.mirahezewikimedia.org/wiki/Data:' .. dataset)
end
 
Line 175:
-- Given a dataset name, convert it to a title with the 'commons:data:' prefix
link = function(dataset)
return 'commonsc:Data:' .. mw.text.trim(dataset or '')
end