Module:Data to Table: Difference between revisions
ReisuDesign (talk | contribs) No edit summary |
ReisuDesign (talk | contribs) No edit summary |
||
| Line 77: | Line 77: | ||
-- Build result | -- Build result | ||
local result = mw.html.create( | local result = mw.html.create() | ||
:wikitext('return {\n') | :wikitext('return {\n') | ||
for _, entry in lib.spairs( | for _, entry in lib.spairs( | ||
| Line 153: | Line 147: | ||
values:wikitext( | values:wikitext( | ||
'\n', | |||
string.rep('\t', level - 1), | |||
'},' | '},' | ||
) | ) | ||
| Line 180: | Line 173: | ||
result:wikitext('}') | result:wikitext('}') | ||
-- Wrap output in syntaxhighlight | |||
local output = frame:extensionTag( | |||
'syntaxhighlight', | |||
tostring(result), | |||
{ | |||
lang = 'lua', | |||
copy = '' | |||
} | |||
) | |||
-- Copy button | -- Copy button | ||
if frame.args.copy then | if frame.args.copy then | ||
output = require('Module:CopyText')._main({ | |||
output, | |||
frame.args.copy, | frame.args.copy, | ||
'Copy Table' | 'Copy Table' | ||
| Line 190: | Line 195: | ||
end | end | ||
return | return output | ||
end | end | ||