Module:Test: Difference between revisions

From Resonite Wiki
mNo edit summary
mNo edit summary
Line 2: Line 2:


function p.ProtoFlux( frame )
function p.ProtoFlux( frame )
  local t = mw.text.jsonDecode( frame.args.Inputs );
  local inputsDecode = mw.text.jsonDecode( frame.args.Inputs );
local outputsDecode = mw.text.jsonDecode( frame.args.Outputs );
  local div = mw.html.create( 'div' );
  local div = mw.html.create( 'div' );
  for k,v in pairs(t) do
  for k,v in pairs(inputsDecode) do
  div:wikitext( k .. '=' .. v );
end
for k,v in pairs(outputsDecode) do
   div:wikitext( k .. '=' .. v );
   div:wikitext( k .. '=' .. v );
  end
  end

Revision as of 01:51, 13 January 2024

Documentation for this module may be created at Module:Test/doc

local p = {}

function p.ProtoFlux( frame )
 local inputsDecode = mw.text.jsonDecode( frame.args.Inputs );
 local outputsDecode = mw.text.jsonDecode( frame.args.Outputs );
 local div = mw.html.create( 'div' );
 for k,v in pairs(inputsDecode) do
  div:wikitext( k .. '=' .. v );
 end
 for k,v in pairs(outputsDecode) do
  div:wikitext( k .. '=' .. v );
 end
 return tostring( div );
end

return p