Module:Test: Difference between revisions

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


  local protofluxContainer = mw.html.create( 'table' );
  local protofluxContainer = mw.html.create( 'table' );
  protofluxContainer:addClass( 'infobox' );
  protofluxContainer = protofluxContainer:addClass( 'infobox' );
  protofluxContainer:wikitext( 'test' );
  protofluxContainer = protofluxContainer:wikitext( 'test' );


  for k,v in pairs( inputsDecode ) do
  for k,v in pairs( inputsDecode ) do
   protofluxContainer:wikitext( k .. '=' .. v );
   protofluxContainer = protofluxContainer:wikitext( k .. '=' .. v );
  end
  end
  for k,v in pairs( outputsDecode ) do
  for k,v in pairs( outputsDecode ) do
   protofluxContainer:wikitext( k .. '=' .. v );
   protofluxContainer = protofluxContainer:wikitext( k .. '=' .. v );
  end
  end
  return tostring( protofluxContainer );
  return tostring( protofluxContainer );

Revision as of 02:15, 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 protofluxContainer = mw.html.create( 'table' );
 protofluxContainer = protofluxContainer:addClass( 'infobox' );
 protofluxContainer = protofluxContainer:wikitext( 'test' );

 for k,v in pairs( inputsDecode ) do
  protofluxContainer = protofluxContainer:wikitext( k .. '=' .. v );
 end
 for k,v in pairs( outputsDecode ) do
  protofluxContainer = protofluxContainer:wikitext( k .. '=' .. v );
 end
 return tostring( protofluxContainer );
end

return p