قالب:جسيم تحت ذري/doc
Purpose
A templates to be used for displaying subatomic particles with or without a link.
Arguments
{{SubatomicParticle|PARTICLE NAME
|link=
}}
If the parameter |link=yes
is set, then the particle symbol will link to the appropriate wikipedia article.
Errors
Errors will happen when the particle specified is not implemented in {{SubatomicParticle/symbol}} and/or {{SubatomicParticle/link}}. Errors will show up as an error message on the page instead of the expected symbol. Pages that have such errors are added to Category:Pages with incorrect formatting templates use.
Examples
{{SubatomicParticle|Electron}}
-> e−{{SubatomicParticle|Muon antineutrino|link=yes}}
-> νμ
(See Template:SubatomicParticle/list for a complete list of supported particles.)
Dependencies
- This template uses {{SubatomicParticle/symbol}} to get the symbols for the individual particles.
- This template uses {{SubatomicParticle/link}} to get the wikipedia page to link to for the individual particles.
Adding new particles
Not all particles have been added yet. Feel free to add new particles when you find they do not yet exist. Here's how to do that:
Add Symbol
Go to {{SubatomicParticle/symbol}} and edit it to see the code for the template. There is a switch statement there that has an entry for each particle which allows this template to return how to display each symbol. You should decide upon a good name for the particle and create a new entry for the it. The entries do not need to be in a particular order for the template to work, but it makes finding them a lot easier if you put all similar particles grouped close to eachother. If there are multiple ways of spelling the name or there are multiple names for a particle, consider making multiple entries with the same info. The entry should look like this:
|particle name (lowercase)={{PhysicsParticle|arguments}}
Have a look at {{PhysicsParticle}} to see what you can do with it. Here are two examples of entries for the electron (e−), which is relatively simple and for the neutral charmed anti B meson (Error in {{SubatomicParticle/symbol}}: unknown particle Charmed antib0), which is named "charmed antib0" and one of the more complex particles to create:
|electron={{PhysicsParticle|e|TR=−}}
|charmed antib0={{PhysicsParticle|anti|B|TR=0|BRc=1|BR=c}}
Add Link
Go to {{SubatomicParticle/link}} and edit it. Here you need to create a entry to specify where to link to for each particle, just like in the previous step. Use the same name for you particle here that you used in {{SubatomicParticle/symbol}} or the link argument will not work! If you created multiple entries for the same particle under different names in {{SubatomicParticle/symbol}}, you should do the same here. Editing this is a lot simpler, you just specify the name and the page to link to like so:
|particle name (lowercase)=wikipedia page to link to
Here's the examples entries for electron and charmed anti B meson again:
|electron=electron
|charmed antib0=B meson
Check changes
Go to {{SubatomicParticle/list}} and see if it still renders correctly. If not, you've screwed things up badly and half of wikipedia has become unreadable. Go back to {{SubatomicParticle/symbol}} and {{SubatomicParticle/link}} and undo your changes immediately. After you've undone the damage, you can try to find out what you did wrong and try again. (At some point we'll probably need to create some kind of sandbox for this.) If all is well, you can test your new particle by adding it to this page, this should be fairly simple and self explantory; just copy+paste an existing entry and modify the copy to display your new particle. Again, please put it in a logical place, grouping similar particles together. Let me know if you feel I need to create a step by step explanation of this as well. Please do not omit this step, because people will end up adding the same particle multiple times if they do not know it exists!