Difference between revisions of "Template:Switch/doc"

From Moegirlpedia
Jump to: navigation, search
(Created page with "This series of templates is used to manually show/hide specific strings and to specify strings and button styles in bulk. == Usage == ; Note that string designators may be in...")
 
 
Line 10: Line 10:
 
;Templates that require line breaks
 
;Templates that require line breaks
 
<span>When the value of parameter 3 is </code>span</code> (when this template cannot take effect): <pre>{{Switch/Button
 
<span>When the value of parameter 3 is </code>span</code> (when this template cannot take effect): <pre>{{Switch/Button
|span1=显示gifts
+
|span1=Switch gifts
 
}}{{Switch|span1|
 
}}{{Switch|span1|
 
{{bilibiliVideo|id=BV1nC4y147iy|page=1|width=600|height=421|autoplay=yes}}<nowiki/>
 
{{bilibiliVideo|id=BV1nC4y147iy|page=1|width=600|height=421|autoplay=yes}}<nowiki/>
 
|span}}</pre>
 
|span}}</pre>
{{切换显示按钮
+
{{Switch/Button
|span1=显示gifts
+
|span1=Switch gifts
 
}}{{Switch/Button|span1|
 
}}{{Switch/Button|span1|
 
{{bilibiliVideo|id=BV1nC4y147iy|page=1|width=600|height=421|autoplay=yes}}<nowiki/>
 
{{bilibiliVideo|id=BV1nC4y147iy|page=1|width=600|height=421|autoplay=yes}}<nowiki/>
Line 21: Line 21:
  
 
<div> When the value of parameter 3 is <code>div</code>: <pre>{{Switch/Button
 
<div> When the value of parameter 3 is <code>div</code>: <pre>{{Switch/Button
|div1=显示gifts
+
|div1=Switch gifts
}}{{切换显示|div1|
+
}}{{Switch|div1|
 
{{bilibiliVideo|id=BV1nC4y147iy|page=1|width=600|height=421|autoplay=yes}}<nowiki/>
 
{{bilibiliVideo|id=BV1nC4y147iy|page=1|width=600|height=421|autoplay=yes}}<nowiki/>
 
|div}}</pre>
 
|div}}</pre>
 
{{Switch/Button
 
{{Switch/Button
|div1=显示gifts
+
|div1=Switch gifts
 
}}{{Switch|div1|
 
}}{{Switch|div1|
 
{{bilibiliVideo|id=BV1nC4y147iy|page=1|width=600|height=421|autoplay=yes}}<nowiki/>
 
{{bilibiliVideo|id=BV1nC4y147iy|page=1|width=600|height=421|autoplay=yes}}<nowiki/>
Line 33: Line 33:
 
;Templates that do not require line breaks
 
;Templates that do not require line breaks
 
<div>When the value of parameter 3 is <code>span</code>: <pre>{{Switch/Button
 
<div>When the value of parameter 3 is <code>span</code>: <pre>{{Switch/Button
|span2=显示丘比
+
|span2=Switch Ruby
 
}}{{Switch|span2|
 
}}{{Switch|span2|
 
{{颜文字|丘比}}<nowiki/>
 
{{颜文字|丘比}}<nowiki/>
 
|span}}</pre>
 
|span}}</pre>
{{切换显示按钮
+
{{Switch/Button
|span2=显示丘比
+
|span2=Switch Ruby
}}{{切换显示|span2|
+
}}{{Switch|span2|
{{颜文字|丘比}}<nowiki/>
+
{{颜文字|Euby}}<nowiki/>
 
|span}}</div>
 
|span}}</div>
  
 
<div>When the value of parameter 3 is <code>div</code>: <pre>{{Switch/Button
 
<div>When the value of parameter 3 is <code>div</code>: <pre>{{Switch/Button
|div2=显示丘比
+
|div2=Switch Ruby
 
}}{{Switch|div2|
 
}}{{Switch|div2|
{{颜文字|丘比}}<nowiki/>
+
{{颜文字|Ruby}}<nowiki/>
 
|div}}</pre>
 
|div}}</pre>
 
{{Switch/Button
 
{{Switch/Button
|div2=显示丘比
+
|div2=Switch Ruby
}}{{切换显示|div2|
+
}}{{Switch|div2|
{{颜文字|丘比}}<nowiki/>
+
{{颜文字|Ruby}}<nowiki/>
 
|div}}</div>
 
|div}}</div>
  

Latest revision as of 21:48, 1 May 2022

This series of templates is used to manually show/hide specific strings and to specify strings and button styles in bulk.

Usage

Note that string designators may be in lowercase English letters, uppercase English letters, Chinese characters, etc. (not considered wikitext).
  • Must not contain', ", <, >, \, /, |, do not start with @ at the beginning; otherwise it will be ignored;
{{Switch|Item 1|Item 2|Item 3}}
Required, used to specify the string that needs to be manually switched. There is no limit to this parameter.
Templates that require line breaks
When the value of parameter 3 is span (when this template cannot take effect):
{{Switch/Button
|span1=Switch gifts
}}{{Switch|span1|
{{bilibiliVideo|id=BV1nC4y147iy|page=1|width=600|height=421|autoplay=yes}}<nowiki/>
|span}}
Switch giftsSwitch giftsspan1span1
Wide ModeShow
Wide ModeShow
spanspan
When the value of parameter 3 is div:
{{Switch/Button
|div1=Switch gifts
}}{{Switch|div1|
{{bilibiliVideo|id=BV1nC4y147iy|page=1|width=600|height=421|autoplay=yes}}<nowiki/>
|div}}
Switch giftsSwitch gifts


Templates that do not require line breaks
When the value of parameter 3 is span:
{{Switch/Button
|span2=Switch Ruby
}}{{Switch|span2|
{{颜文字|丘比}}<nowiki/>
|span}}

Switch RubySwitch Ruby

When the value of parameter 3 is div:
{{Switch/Button
|div2=Switch Ruby
}}{{Switch|div2|
{{颜文字|Ruby}}<nowiki/>
|div}}
Switch RubySwitch Ruby

Wikitext that requires line breaks

添加表格
Note: 由于表格wikitext较为Template:Rubyh,里面所有带有|的格式符号都需要进行替换。
当然,任何时候=都需要替换。

Template:Example

Add other wikitext that need line breaks
Note: 此处的<nowiki/>与wikitext之间应换行,否则wikitext会失效。

Template:Example

Related