Module:Sandbox/ChaoticShadow/SongDataLine: Difference between revisions
Content added Content deleted
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
local p = {} |
local p = {} |
||
local args = {} |
local args = {} |
||
local root = mw.html.create('ul') |
|||
local what = '' |
|||
function split(inputstr, sep) |
|||
if sep == nil then |
|||
sep = "%s" |
|||
end |
|||
local t={} |
|||
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do |
|||
table.insert(t, str) |
|||
end |
|||
return t |
|||
end |
|||
function p.main(frame) |
function p.main(frame) |
||
args = getArgs(frame) |
args = getArgs(frame) |
||
return mw.text.jsonEncode(args) |
|||
what = what .. v |
|||
local lines = split(v, "\n") |
|||
root:tag('li'):wikitext(table.concat(lines, "<br>")) |
|||
end |
|||
return '<pre>' .. mw.dumpObject(args) .. '</pre>' |
|||
.. '<br>' .. |
|||
'<pre>' .. what .. '</pre>' |
|||
.. '<br>' .. |
|||
tostring(root) |
|||
end |
end |
||
Latest revision as of 04:19, 9 August 2021
Documentation for this module may be created at Module:Sandbox/ChaoticShadow/SongDataLine/doc