Bước tới nội dung

Bản mẫu:SubatomicParticle

Bách khoa toàn thư mở Wikipedia
Tài liệu bản mẫu[xem] [sửa] [lịch sử] [làm mới]

Bản mẫu này dùng để hiện các hạt hạ nguyên tử với liên kết hoặc không.

Arguments[sửa mã nguồn]

{{SubatomicParticle|PARTICLE NAME|link=}}

If the parameter |link=yes is set, then the particle symbol will link to the appropriate wikipedia article.

Errors[sửa mã nguồn]

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[sửa mã nguồn]

{{SubatomicParticle|Electron}} -> e
{{SubatomicParticle|Muon antineutrino|link=yes}} -> ν

(See Template:SubatomicParticle/list for a complete list of supported particles.)

Dependencies[sửa mã nguồn]

Adding new particles[sửa mã nguồn]

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[sửa mã nguồn]

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 strange anti B meson (B
), which is named "strange antib0" and one of the more complex particles to create:

|strange antib0={{PhysicsParticle|anti|B|TR=0|BRc=1|BR=s}}

Add Link[sửa mã nguồn]

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:

|charmed antib0=B meson

Check changes[sửa mã nguồn]

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!

Xem thêm[sửa mã nguồn]