Difference between revisions of "Module:IPC"

 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
my_object = {};    --All lua modules on Wikipedia must begin by defining a variable
+
{| class=infobox
                    --that will hold their externally accessible functions.
+
|-
                    --Such variables can have whatever name you want and may
+
|
                    --also contain various data as well as functions.
+
*name           = Electron
 
+
*image          = [[File:HAtomOrbitals.png|280px]]
my_object.hello = function( frame )    --Add a function to "my_object".
+
*caption        = Hydrogen atom [[atomic orbital|orbitals]] at different energy levels.  
                                        --Such functions are callable in Wikipedia
+
*num_types      =
                                        --via the #invoke command.
+
*composition    = [[Elementary particle]]<ref name="prl50"/>
                                        --"frame" will contain the data that Wikipedia
+
*statistics      = [[Fermion]]ic
                                        --sends this function when it runs.
+
*group          = [[Lepton]]
   
+
*generation      = First
    local str = "Hello World!"  --Declare a local variable and set it equal to
+
*interaction     = [[Gravitation|Gravity]], [[Lorentz force|electromagnetic]], [[Weak interaction|weak]]
                                --"Hello World!". 
+
*antiparticle   = [[Positron]] (also called antielectron)
      
+
*theorized      = [[Richard Laming]]
    return str   --This tells us to quit this function and send the information in
+
*discovered      = [[J. J. Thomson]] (1897)<ref name="thomson"/>
                  --"str" back to Wikipedia.
+
*symbol          = {{SubatomicParticle|Electron}}, {{SubatomicParticle|beta-}}
   
+
*mass            = {{val|9.10938356|(11)|e=-31|ul=kg}}<ref name="2010 CODATA" /><br /><!--
end  -- end of the function "hello"
+
|}
 
 
return my_object    --All modules end by returning the variable containing its
 
                    --functions to Wikipedia.
 
 
 
-- Now we can use this module by calling {{#invoke: HelloWorld | hello }}.
 
-- Note that the first part of the invoke is the name of the Module's wikipage,
 
-- and the second part is the name of one of the functions attached to the
 
-- variable that you returned.
 
 
 
-- The "print" function is not allowed in Wikipedia.  All output is accomplished
 
-- via strings "returned" to Wikipedia.
 

Latest revision as of 23:16, 20 July 2016

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

Script error: Lua error: Internal error: The interpreter exited with status 127.

{| class=infobox
|-
|
*name            = Electron
*image           = [[File:HAtomOrbitals.png|280px]]
*caption         = Hydrogen atom [[atomic orbital|orbitals]] at different energy levels. 
*num_types       =
*composition     = [[Elementary particle]]<ref name="prl50"/>
*statistics      = [[Fermion]]ic
*group           = [[Lepton]]
*generation      = First
*interaction     = [[Gravitation|Gravity]], [[Lorentz force|electromagnetic]], [[Weak interaction|weak]]
*antiparticle    = [[Positron]] (also called antielectron)
*theorized       = [[Richard Laming]] 
*discovered      = [[J. J. Thomson]] (1897)<ref name="thomson"/>
*symbol          = {{SubatomicParticle|Electron}}, {{SubatomicParticle|beta-}}
*mass            = {{val|9.10938356|(11)|e=-31|ul=kg}}<ref name="2010 CODATA" /><br /><!--
|}