Module:Sandbox/ChaoticShadow/SongDataLine: Difference between revisions
Content added Content deleted
No edit summary |
No edit summary |
||
(5 intermediate revisions 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 string:split(delimiter) |
|||
local result = { } |
|||
local from = 1 |
|||
local delim_from, delim_to = string.find( self, delimiter, from ) |
|||
while delim_from do |
|||
table.insert( result, string.sub( self, from , delim_from-1 ) ) |
|||
from = delim_to + 1 |
|||
delim_from, delim_to = string.find( self, delimiter, from ) |
|||
end |
|||
table.insert( result, string.sub( self, from ) ) |
|||
return result |
|||
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 = tostring(v):split("\n") |
|||
for _,line in ipairs(lines) do |
|||
root:tag('li'):wikitext(line) |
|||
end |
|||
end |
|||
return '<pre>' .. mw.dumpObject(args) .. '</pre>' |
|||
.. '<br>' .. |
|||
'<pre>' .. what .. '</pre>' |
|||
end |
end |
||
Latest revision as of 04:19, 9 August 2021
Documentation for this module may be created at Module:Sandbox/ChaoticShadow/SongDataLine/doc