Difference between revisions of "User:Tark/Sandbox"

From Team Fortress Wiki
Jump to: navigation, search
m (Replaced content with "<div class="youtubebox ratio-{{{ratio|16x9}}} widths-{{{width|512}}}" style="margin:0.75em 0em;"><div class="embedvideo autoResize">{{#if: {{{align|}}}|<div class="embedvi...")
(Tag: Replaced)
m
(23 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div class="youtubebox ratio-{{{ratio|16x9}}} widths-{{{width|512}}}" style="margin:0.75em 0em;"><div class="embedvideo autoResize">{{#if: {{{align|}}}|<div class="embedvideowrap bilibili-videov2" data-vaid="{{#expr:{{{1|}}}}}" data-vdanmaku="{{#expr:{{{danmaku|0}}}}}" data-vpage="{{#expr:{{{page|1}}}}}" data-vwidth="{{#expr:{{{width|640}}}}}" data-vheight="{{#expr:{{{height|360}}}}}" style="text-align: {{{align|}}}"></div>|<div class="embedvideowrap bilibili-videov2" data-vaid="{{#expr:{{{1|}}}}}" data-vdanmaku="{{#expr:{{{danmaku|0}}}}}" data-vpage="{{#expr:{{{page|1}}}}}" data-vwidth="{{#expr:{{{width|640}}}}}" data-vheight="{{#expr:{{{height|360}}}}}"></div>}}</div>{{#if:{{{2|<noinclude>yes</noinclude>}}}| <br /><div>{{hatnote|1={{{2|Caption here.}}}}}}}</div><noinclude>
+
<div id="template-documentation" style="clear: both; margin: 1em 0 0 0; border: 1px solid #aaa; background-color: #ecfcf4; padding: 1em; font-family: sans-serif">
{{Doc begin}}
+
<div style="padding-bottom:3px;border-bottom:1px solid #aaa;margin-bottom:1ex">
This template will embed a Bilibili video inside an article.
 
  
=== Usage ===
+
'''Item infobox:'''
* <code><nowiki>{{bilibili|710126347}}</nowiki></code> produces: {{bilibili|710126347}}
+
* Update <code>used-by</code>
* <code><nowiki>{{bilibili|21525619|Ready Up: Competitive Team Fortress 2 Documentary|width=512|height=320|align=center}}</nowiki></code> produces: {{bilibili|21525619|Ready Up: Competitive Team Fortress 2 Documentary|width=512|height=320|align=center}}
+
** Use {{tlx|Used by}}.
* <code><nowiki>{{bilibili|96157214|danmaku=1}}</nowiki></code> produces: {{bilibili|96157214|danmaku=1}}
+
*** <code><nowiki>used-by = [[Spy]]</nowiki></code>/<code><nowiki>used-by = {{used by|Spy}}</nowiki></code>/etc. should be changed to <code>used-by = Spy</code>.
* <code><nowiki>{{bilibili|710381282|page=6}}</nowiki></code> produces: {{bilibili|710381282|page=6}}
+
*** Figure out how to handle ''all-except''.
 +
* Update <code>item-kind</code>
 +
** Use {{tlx|item name|item type {{{item-kind}}}}}.
 +
* Change <code>item-description</code> to <code>yes</code>/<code>no</code> values.
 +
** If yes, use the dictionary string.
 +
** If, for some odd reason, the description can't be stored in the dictionary, use <code>item-description-override</code> to display a custom one.
 +
* Update <code>unusual-effect</code>
 +
** See [https://wiki.teamfortress.com/w/index.php?title=Template%3AItem_infobox%2FSandbox&type=revision&diff=3610124&oldid=3610122 this diff].
 +
** Use {{tlx|item name|{{{unusual-effect}}}}}.
 +
* Update <code>item-flags</code>
 +
** See [https://wiki.teamfortress.com/w/index.php?title=Template%3AItem_infobox%2FSandbox&type=revision&diff=3610124&oldid=3610122 this diff].
 +
** Maybe keep the English text (e.g., "Not Tradable") instead of the attribute name (e.g., "CannotTrade") for readability.
 +
* Update <code>att-n-[type]</code>
 +
** See [https://wiki.teamfortress.com/w/index.php?title=Template%3AItem_infobox%2FSandbox&type=revision&diff=3610124&oldid=3610122 this diff].
 +
** Use {{tlx|attribute}} (see template documentation).
  
=== Parameters ===
+
<hr>
; Bilibili aid (<span style="color: red">required</span>): This is the Bilibili video ID of the video you want to display.
+
'''WindBOT:'''
:: You can find this information by [https://i.imgur.com/A4KY931.png copying the iframe code] and searching for the "aid" parameter or though the [https://api.bilibili.com/x/web-interface/view?bvid= Web Interface] ("bvid" can be found in the URL: <nowiki>https://www.bilibili.com/video/</nowiki><span style="color: red">BV1mQ4y1M7Cn</span>).
 
; Caption: Custom caption to include.
 
; {{code|width}}: Width of the video, in pixels. Default is '''640'''.
 
; {{code|height}}: Height of the video, in pixels. Default is '''360'''.
 
; {{code|align}}: Horizontal alignment of video. Default is '''left'''.
 
; {{code|danmaku}}: Bullet screen/danmaku subtitles. Default is '''0''' (disabled).
 
; {{code|page}}: Videos uploaded in a playlist format share the same ID, you can use this parameter to specify which video to display. Default is '''1''' (first video).
 
  
=== See also ===
+
* Sync <code>used-by</code>
* {{tl|bilibili tn}}
+
* Sync <code>released</code> & <code>released-major</code>.
 +
** If <code>released-major</code> is set, sync <code>released</code> and <code>released-major</code>.
 +
** If <code>released</code> is set to {{tlx|Patch name}}, sync <code>released</code>.
 +
** Otherwise, skip.
 +
* Sync <code>availability</code>
 +
** {{tlx|avail}} needs to be updated to handle single-use cases (e.g., [[Wiki Cap]], [[Lo-Fi Longwave]], others).
 +
* Sync <code>item-kind</code>
 +
* Sync <code>item-description</code>
 +
* Sync <code>unusual-effect</code>
 +
* Sync <code>item-flags</code>
 +
* Sync <code>att-n-[type]</code>
  
[[Category:Formatting templates|Bilibili]]
+
''Note: "Sync" here means that when WindBOT is updating a translated page, e.g., [[Unusual Cap/ru]], it should seek the values of the original template instead, as we assume the English page is the one which is up to date.''
</noinclude>
 

Revision as of 12:30, 13 May 2024

Item infobox:

  • Update used-by
    • Use {{Used by}}.
      • used-by = [[Spy]]/used-by = {{used by|Spy}}/etc. should be changed to used-by = Spy.
      • Figure out how to handle all-except.
  • Update item-kind
  • Change item-description to yes/no values.
    • If yes, use the dictionary string.
    • If, for some odd reason, the description can't be stored in the dictionary, use item-description-override to display a custom one.
  • Update unusual-effect
  • Update item-flags
    • See this diff.
    • Maybe keep the English text (e.g., "Not Tradable") instead of the attribute name (e.g., "CannotTrade") for readability.
  • Update att-n-[type]

WindBOT:

  • Sync used-by
  • Sync released & released-major.
    • If released-major is set, sync released and released-major.
    • If released is set to {{Patch name}}, sync released.
    • Otherwise, skip.
  • Sync availability
  • Sync item-kind
  • Sync item-description
  • Sync unusual-effect
  • Sync item-flags
  • Sync att-n-[type]

Note: "Sync" here means that when WindBOT is updating a translated page, e.g., Unusual Cap/ru, it should seek the values of the original template instead, as we assume the English page is the one which is up to date.