一什么被子| 换药挂什么科| 避讳是什么意思| 吃什么补胶原蛋白| 今年是什么命| 坐月子可以吃什么| 纹身有什么危害| 失独是什么意思| 疯狂动物城狐狸叫什么| 灵芝有什么功效与作用| 为什么会突然不爱了| 小脑萎缩有什么症状| 干眼症用什么眼药水| 做功是什么意思| 小孩掉头发是什么原因| 梦到活人死了是什么预兆| 男人梦见鱼是什么征兆| 天安门以前叫什么| 女人吃当归有什么好处| 孕妇待产需要准备什么| 1901年属什么生肖| 什么动物捉害虫| 治霉菌性阴炎用什么药好得快| 海豹油有什么功效| 老舍为什么自杀| 太阳像什么的比喻句| 千秋无绝色悦目是佳人什么意思| 看见黑猫代表什么预兆| 解大便时有鲜血流出是什么原因| 插入阴道什么感觉| 月经一直不干净是什么原因| 250为什么是骂人的话| 吃什么补血效果最好| 红色学士服是什么学位| 乙肝五项15阳性是什么意思| 餐饮sop是什么意思| 止咳平喘什么药最有效| 什么的山野| 无与伦比是什么意思| 乳腺增生有什么症状| 吃什么可以提高免疫力和抵抗力| 人中长痘痘什么原因| 撤退性出血什么意思| 腺管瘤是什么| 铁剂不能和什么一起吃| 什么石头最值钱| 向日葵的花语是什么| 高血压一级是什么意思| 正常龟头什么样子| 一品诰命夫人是什么意思| 甘油三酯高用什么药好| 什么叫十二指肠球炎| 气虚便秘吃什么中成药| 1.20是什么星座| 后背出汗什么原因| 小孩喜欢趴着睡觉是什么原因| 结扎对男的有什么影响| 煞是什么意思| 南瓜为什么叫南瓜| 吃了虾不能吃什么| 眼底出血是什么原因引起的| 塑胶厂是做什么的| 怀孕能吃什么| 什么药可以流产| 慢性胃炎吃什么中成药| 肺气肿是什么原因引起的| 手热脚凉是什么原因| 状元红又叫什么荔枝| 古驰属于什么档次| 月子里吃什么饭最好| 回族为什么姓马的多| 降结肠疼是什么原因| 胰腺炎吃什么食物| 尿酸挂什么科| 甲基苯丙胺是什么| 菜籽油是什么菜籽做的| 此生不换什么意思| 白细胞30是什么意思| 霞字五行属什么| 傍大款是什么意思| 蚂蚁喜欢什么环境| 孔子名什么| 掂过碌蔗是什么意思| 网球大满贯什么意思| 青蛙长什么样| 尿液浑浊是什么原因| 酒喝多了喝什么解酒| 拉肚子拉水是什么原因| 帝女花讲的是什么故事| 双鱼和什么星座最配对| 团长转业到地方是什么职务| 中性粒细胞偏低是什么意思| 左脸上长痘痘是什么原因| 口臭口干口苦是什么原因| 颈动脉强回声斑块是什么意思| 橙字五行属什么| 赤子是什么意思| 分诊是什么意思| 2b什么意思| 男生来大姨夫是什么意思| 黄花梨树长什么样| 什么东西能吃不能碰| 空腹血糖高吃什么药| 尿常规白细胞高是什么原因| 预防心肌梗塞吃什么药最好| 天德月德是什么意思| 不完全骨折是什么意思| 芦根煮水的功效是什么| 百合什么时候开花| 立春吃什么食物| 加持是什么意思| 白头发吃什么可以变黑| 狗眼看人低是什么意思| 丫丫的老公叫什么| 对酒当歌是什么生肖| 2020属什么生肖| 支气管疾患是什么意思| 脸上长斑是什么原因| Preparing什么意思| huidr是什么品牌| 什么是眼底病| 亲嘴为什么要伸舌头| 指什么为什么| 爬虫什么意思| 天上的星星为什么会发光| 空腹喝牛奶为什么会拉肚子| 分泌性中耳炎吃什么药| x是什么品牌| color是什么意思| 牙龈疼是什么问题| 晚上十一点多是什么时辰| 老年人头晕挂什么科| 岔气吃什么药| 黄柏的功效与作用是什么| 辄的意思是什么| 每天头疼是什么原因引起的| 痛风吃什么药效果最好| 氯化钾是什么东西| 脾胃虚吃什么调理| 江郎才尽是什么意思| 喝碱性水有什么好处| 中老年吃什么钙片比较好| 吃中药能吃什么水果| 肾阳虚吃什么药最好| 定增是什么意思| 泡黄芪水喝有什么好处| 耳前瘘管有什么危害| 痔疮看什么科室| 酒不能和什么一起吃| tomboy什么意思| 吃什么排气| 3.8号是什么星座| eeg是什么意思| 血糖偏高可以吃什么水果| hpv是什么病毒| 丧尽天良什么意思| 什么的大自然| 吃瓜子有什么好处| 红斑狼疮是什么病| 梦见墓碑是什么意思| 卵巢炎症有什么症状| 扁平足适合穿什么鞋| 大保健是什么意思| t11椎体在什么位置| 联票是什么意思| 壬申日是什么意思| 宫寒是什么| 十月十六号是什么星座| 胃下垂吃什么药最好| 脑炎是什么病严重吗| 双十一是什么节日| 孩子为什么会得抽动症| 煮红枣为什么有白色的漂浮物| 哺乳期胃疼可以吃什么药| 什么人容易得帕金森| 汗疱疹吃什么药| 转氨酶高是什么病| 物上代位性是什么意思| 潜力是什么意思| ffa是什么意思| 正觉是什么意思| 为什么身上痒一抓就起疙瘩| 羊癫疯有什么症状表现| 快走对身体有什么好处| 枕秃是什么意思| 身体缺钠会有什么症状| 幼小衔接是什么意思| 小孩子经常流鼻血是什么原因| 什么驴技穷成语| 孩子病毒感染吃什么药| 纤支镜检查是用来查什么的| 为什么拉肚子| 珍惜当下是什么意思| 内痔疮吃什么药最好| 降血脂吃什么药| 脾虚湿盛吃什么中成药| 1月3号是什么星座| 农历11月25日是什么星座| 肝囊肿有什么危害| 徐州二院全名叫什么| 山梨酸是什么| 扁桃体肿大有什么症状| 欧皇是什么意思| 两棵树是什么牌子| 布洛芬0.3和0.4g有什么区别| aspirin是什么意思| 张柏芝和谢霆锋为什么离婚| 悬钟为什么叫绝骨| 不什么下什么的成语| 桑蚕丝用什么洗最好| 肝硬化吃什么好| 近视和远视有什么区别| 兰州有什么特产| 吃茄子有什么坏处| 地球属于什么星| 女人左眼皮跳是什么预兆| 巴郎子是什么意思| 1995是什么年| 白露节气的含义是什么| 便秘吃什么药效果最好| 七月五日是什么星座| 百田森的鞋什么档次| 冰是什么意思| 双开什么意思| 天蝎座男生喜欢什么样的女生| 子宫肌瘤吃什么食物| 经常腰酸是什么原因女性| 十灵日是什么意思| 婴儿什么时候长牙齿| 西瓜坏了是什么样| 晚上做噩梦是什么原因| 胃溃疡吃什么食物好| 失眠多梦吃什么药效果最好| 白里透红的透是什么意思| 咽炎吃什么药好使| 缓刑是什么意思| 缺硒有什么症状| 规整是什么意思| 裂纹舌是什么原因| 胃立康片适合什么病| 平均红细胞体积偏高说明什么| 蛇床子是什么| 孩子血铅高有什么症状| 汝窑开片是什么意思| 世子是什么意思| 12583是什么电话| azul是什么颜色| 狗为什么吐舌头| 乌鸡炖什么好吃| 梦见捡到钱是什么意思| 男才女貌是什么意思| 贝五行属什么| 国老是什么中药| 梦见被狗咬是什么意思| 幼犬拉稀吃什么药最好| 大便泡沫状是什么原因| 向日葵什么时候种| 处女座和什么星座最配| 腮腺炎吃什么消炎药| 吃什么利尿最快| 石见读什么| 府尹相当于现在什么官| 气化是什么意思| 什么水不能喝脑筋急转弯| 百度Jump to content

最新文件!上海发布13项装配式建筑示范项目创新技术

Page semi-protected
From Wikipedia, the free encyclopedia
百度 步骤:1.豆芽,小白菜,这两盘用水焯一下!放入大盆中2.将鱼洗净,片成鱼片,并把剩下的鱼排剁成几块。

Templates are a very powerful feature of the MediaWiki software used for Wikipedia, but mistakes can be easily made, even by experienced users. Edits to complex templates should therefore be carried out in sandboxes and accompanied by test cases to prevent bugs. Temporary sandboxes X1-X20 or the Template Sandbox may be useful places to try new experiments or for users new to template development.

For the development of entirely new templates, user sandboxes are appropriate.

Sandbox and testcases subpage naming

Most protected templates already have a sandbox subpage and testcases subpage. The names of these pages are default. At the bottom of each template's page are links to create/edit the template's sandbox and testcases pages.

For example, here are the subpages for {{FlagIOCmedalist}}:

Template Link
Main template Template:FlagIOCmedalist
Template's sandbox Template:FlagIOCmedalist/sandbox
Template's testcases page Template:FlagIOCmedalist/testcases

What kind of templates should you use sandbox for

It is highly recommended to apply the test case pattern to templates using ParserFunctions that can generate very different looking output, such as ones that take many parameters, or the ones that have many branches of the #switch operator.

For navigational boxes with mostly identical results on each transcluding page, the benefit may not outweigh the time and effort to create a sandbox page, but if in doubt, sandbox it. Any template that is marked as a High-risk Template should always be tested before an edit is made. With other pages, you should still check which pages use the template (via the "What Links Here" link in the Tools section of the linkbar at the left side of the screen).

How to create /sandbox and /testcases subpages

  1. Suppose your template is named Template:X. Create a subpage with the name Template:X/sandbox. If the main template is using the {{documentation}} template, you can do this from a link at the bottom of the blue documentation box on the template main page. Or you can type it into the search box, or directly into the URL bar of your browser. Note that "/sandbox" is all lowercase.
  2. Copy the entire contents of the main template, including <noinclude> tags and the {{documentation}} template if present, paste it into the edit window of the /sandbox subpage, and save the page. Your edit summary should be something like create sandbox version of [[Template:X]].
  3. Create another subpage with the name Template:X/testcases. This page is only linked from the bottom of the blue documentation box if it actually exists, so to create it you will need to create it by typing the page name into the search box or into the URL bar of your browser. Again, note that "/testcases" is all lowercase, and all one word.
  4. Put the {{testcases notice}} template at the top of the page, add some test cases (see below), and save the page.
  5. Add your experimental code to Template:X/sandbox. To test your code, save the page, and go to the /testcases page. Often you will need to purge the /testcases page to see the updated results; there is a link to do that included in the {{testcases notice}} template. After you've purged the page, compare the results for the main template with the results from the sandbox, and if everything looks okay, you can update the main template. However, be wary of missing test cases and of code that can only be tested in certain namespaces or on certain pages.

How to update existing /sandbox and /testcases subpages

To make a change to a template which already has /sandbox and /testcases subpages, the process is similar to the above.

  1. The /sandbox may not have the latest version of the template code in it, so before you make a change, you need to synchronize it with the main template. Copy the entire contents of the main template to the /sandbox subpage, and save the page. Your edit summary should be something like "synchronize with the main template", or simply "sync".
  2. Have fun editing the sandbox. When you have some code you want to test, save the page.
  3. If you have added any new features or changed any parameters, you should add new test cases to the /testcases subpage so that they can be tested. Also, bear in mind that the existing test cases may not be complete. It's okay to rewrite the test cases if they aren't useful for what you're trying to achieve, but also consider editors who may use the test cases after you.
  4. Purge the /testcases page to update the results.
  5. Verify that the test case results are correct. If everything looks good, copy the code from the sandbox to the main template.

Adding test cases

On the /testcases page, there should be one test case for each different behaviour of your template. For example, if your template outputs a banner message, and if the parameter |italic=yes makes that message italicized, you should add one test case for the normal message and one for the italicized message. If that template has another parameter, |date=, where the user inserts the date, then there should be a third test case for that. You should try and be thorough and make cases for all the ways users might use your template; however, it is often impractical to add test cases for every single parameter combination, so you should choose the most relevant ones wisely.

There are quite a few different styles of test case that you can use. Which one you choose depends on the nature of the template you are working on. For example, for short template output that fits on one line, it can be useful to put the test cases inside a wikitable, and for long and thin templates such as infoboxes, it is often best to display them side by side by using {{testcase table}}.

Manual formatting

Manually formatting gives you a great deal of flexibility, but care must be taken to ensure that all the template parameters are entered correctly. An error in one of the test cases is often harder to find than an error in the template itself.

Basic format

This format works well for banner templates and for lengthy text, e.g. citations. Note that you can format these kinds of test automatically using Template:Test case and other similar templates.

== Descriptive title ==
 
* <code><nowiki>{{template|param1=value1|param2=value2}}</nowiki></code>
 
'''Main'''
 
{{template|param1=value1|param2=value2}}
 
'''Sandbox'''
 
{{template/sandbox|param1=value1|param2=value2}}

Each value of template, param1, value1 etc. must be identical.

For templates that use the "float" CSS attribute, you will need to use the {{clear}} template to stop the results from bunching together:

== Descriptive title ==
 
* <code><nowiki>{{template|param1=value1|param2=value2}}</nowiki></code>
 
'''Main'''
 
{{template|param1=value1|param2=value2}}
 
{{clear}}
 
'''Sandbox'''
 
{{template/sandbox|param1=value1|param2=value2}}
 
{{clear}}

Wikitable

Using a wikitable to format test cases is often useful for templates with short output that need to be lined up correctly.

Start the table like this:

{| class="wikitable"
|-
! Code
! Main
! Sandbox

<!-- Each new test case can be added like this: -->

|-
| <code><nowiki>{{template|param1=value1|param2=value2}}</nowiki></code>
| {{template|param1=value1|param2=value2}}
| {{template/sandbox|param1=value1|param2=value2}}

<!-- Finish the table like this: -->

|}

Automatic formatting

There are various templates that help you to format test cases automatically. With these templates, parameters and values are only entered once, but are still tested for both the main template and the sandbox templates. This avoids the problem of errors in test case parameters, and makes it easier to maintain test case pages. These templates include:

Note that all of these templates can produce collapsible test cases, but Template:Collapsible test case has this feature turned on by default. For detailed documentation, see the individual template pages.

Tests that can't be made on /testcases pages

Some template features can't be tested on /testcases pages. For example, a template may only output certain text when in the main namespace, or it may output different things when it is used on a base page and when it is used on a subpage. For these kinds of tests, you can use the "Preview page with this template" feature that you can see underneath the edit window on template pages. To make this feature even more powerful, you can install User:Jackmcbarn/advancedtemplatesandbox.js, which makes it usable in any namespace, and lets you specify the title of the template as well as the page to preview it on. This means that you can edit the sandbox template, but preview pages as if you were actually editing the main template.

If you can think of any tests that can't be made on the /testcases page, it may be helpful to leave a note at the top of the /testcases page outlining what else needs testing, so that future editors of that template are also aware.

Examples

Basic format
Template:Quote, Template:Quote/sandbox and Template:Quote/testcases
Wikitable
Template:Diff, Template:Diff/sandbox and Template:Diff/testcases
Testcase table
Template:Infobox settlement, Template:Infobox settlement/sandbox and Template:Infobox settlement/testcases

See also

什么门不能开 双龙戏珠是什么意思 八个月宝宝可以吃什么水果 免疫五项检查是什么 疱疹是什么样子的
腰肌劳损是什么意思 酒后喝什么解酒 节令是什么意思 血糖用什么字母表示 良去掉一点读什么
白陶土样便见于什么病 女人梦见鬼是什么征兆 入珠是什么 免疫球蛋白低说明什么 五月五日什么星座
胃疼是什么病 脚底疼是什么原因引起的 不走心是什么意思 怀孕肚子痒是什么原因 诸葛亮长什么样
公安局属于什么机关hcv8jop2ns7r.cn 什么人靠别人的脑袋生活0297y7.com 人生得意须尽欢是什么意思dayuxmw.com 吃什么保护眼睛chuanglingweilai.com 包子都有什么馅hcv8jop5ns3r.cn
dsa是什么意思hcv8jop4ns9r.cn 凝血四项是检查什么的hcv8jop8ns3r.cn 果丹皮是用什么做的hcv9jop6ns1r.cn 花青素是什么颜色hcv9jop1ns4r.cn 寒食节是什么时候hcv9jop7ns0r.cn
热结旁流是什么意思zhongyiyatai.com 脸上长白斑是什么原因hcv8jop5ns9r.cn 语字五行属什么hcv9jop5ns3r.cn 打嗝是什么引起的xinmaowt.com 手术后吃什么补品好hcv9jop4ns0r.cn
寄居蟹喜欢吃什么hcv9jop1ns0r.cn ferragamo是什么牌子hcv7jop9ns1r.cn 腹泻挂什么科hcv9jop1ns3r.cn 腰椎间盘突出什么症状hcv7jop5ns4r.cn 什么的脸hcv8jop1ns8r.cn
百度