Template:VP/doc

From DominionStrategy Wiki
(Difference between revisions)
Jump to: navigation, search
(rework to make it more usable for validating template changes)
Line 1: Line 1:
This is a template for VP icon
+
This template may be used to display the icon for [[Victory point|Victory points]].
  
==Usage==
+
== Usage ==
* <tt><nowiki>{{VP}}</nowiki> →  </tt>{{VP}}
+
<pre>{{VP|amount|size}}</pre>
* <tt><nowiki>{{VP|'''5'''|l}}</nowiki> →  </tt>{{VP|'''5'''|l}}
+
* <tt><nowiki>{{VP|'''5'''|xl}}</nowiki> →  </tt>{{VP|'''5'''|xl}}
+
  
Note: Text included in the first parameter is cleared of font styles (mainly italics) outside.<br />
+
DO use the template like in one of the following ways.
Note2: It is not recommend to use the first parameter except when you want it to scale with the size of the VP image.
+
To achieve a consistent styling and line breaking behavior all other forms are not recommended.
 +
 
 +
<pre>
 +
{{VP}}
 +
{{VP|5}}
 +
{{VP|'''5'''}}
 +
{{VP|+5}}
 +
{{VP|'''+5'''}}
 +
{{VP|5|m}}
 +
{{VP|5|l}}
 +
{{VP|5|xl}}
 +
</pre>
 +
 
 +
== Parameters ==
 +
=== Optional ===
 +
; ''amount'' : The amount of [[Victory point|Victory points]]. Is displayed as number in front of the icon in proper size.
 +
; ''size'' : The size of icon and number. Supported sizes: m, l, xl. If omitted it is considered to be displayed inline with text.
 +
 
 +
== Implementation details ==
 +
* ''amount'' is cleared of font styles to prevent outer styles to be effective (mainly italics).
 +
 
 +
== Examples ==
 +
The following examples represent the main use cases throughout the wiki.
 +
 
 +
=== Inline with text ===
 +
<pre>Curse's most obvious penalty is that it gives you {{VP|-1}} at the end of the game.</pre>
 +
Curse's most obvious penalty is that it gives you {{VP|-1}} at the end of the game.
 +
 
 +
=== Inside of infobox ===
 +
{{Infobox Card
 +
|name = Crumbling Castle
 +
|cost = 4
 +
|set = Empires
 +
|type1 = Victory
 +
|type2 = Castle
 +
|illustrator = Julien Delval
 +
|text = {{VP|1|l}}
 +
|text2 = When you gain or trash this, {{VP|'''+1'''}} and gain a Silver.
 +
|nocats = 1
 +
}}
 +
<pre style="overflow:auto">
 +
{{Infobox Card
 +
|name = Crumbling Castle
 +
|cost = 4
 +
|set = Empires
 +
|type1 = Victory
 +
|type2 = Castle
 +
|illustrator = Julien Delval
 +
|text = {{VP|1|l}}
 +
|text2 = When you gain or trash this, {{VP|'''+1'''}} and gain a Silver.
 +
}}
 +
</pre>
 +
<div style="clear:both"></div>
 +
 
 +
{{Infobox Card
 +
|name = Harem
 +
|cost = 6
 +
|type1 = Treasure
 +
|type2 = Victory
 +
|illustrator = Maura Kalusky
 +
|text = {{Cost|2|l}}
 +
|text2 = {{VP|2|l}}
 +
|nocats = 1
 +
}}
 +
<pre style="overflow:auto">
 +
{{Infobox Card
 +
|name = Harem
 +
|cost = 6
 +
|type1 = Treasure
 +
|type2 = Victory
 +
|illustrator = Maura Kalusky
 +
|text = {{Cost|2|l}}
 +
|text2 = {{VP|2|l}}
 +
}}
 +
</pre>
 +
<div style="clear:both"></div>
 +
 
 +
=== Inside of version tables ===
 +
<pre style="overflow-x: auto">
 +
{| class="wikitable" style="text-align:center;"
 +
! Print !! Digital !! Text
 +
|-
 +
| {{CardVersionImage|Crumbling Castle}} || {{CardVersionImage|Crumbling CastleDigital}} || {{VP|1|l}}{{Divline}}When you gain or trash this, {{VP|'''+1'''}} and gain a Silver.
 +
|}
 +
</pre>
 +
{| class="wikitable" style="text-align:center;"
 +
! Print !! Digital !! Text
 +
|-
 +
| {{CardVersionImage|Crumbling Castle}} || {{CardVersionImage|Crumbling CastleDigital}} || {{VP|1|l}}{{Divline}}When you gain or trash this, {{VP|'''+1'''}} and gain a Silver.
 +
|}
 +
 
 +
<pre style="overflow-x: auto">
 +
{| class="wikitable" style="text-align:center;"
 +
! Print !! Digital !! Text
 +
|-
 +
| {{CardLangVersionImage|o=1}} || {{CardLangVersionImage|d=1|o=1}} || style="padding:0px 30px;"| {{Cost|2|l}}<br>{{VP|2|l}}
 +
|-
 +
| {{CardLangVersionImage}} || {{CardLangVersionImage|d=1}} || {{Cost|2|l}}{{Divline}}{{VP|2|l}}
 +
|}
 +
</pre>
 +
{| class="wikitable" style="text-align:center;"
 +
! Print !! Digital !! Text
 +
|-
 +
| {{CardLangVersionImage|o=1|n=Harem}} || {{CardLangVersionImage|d=1|o=1|n=Harem}} || style="padding:0px 30px;"| {{Cost|2|l}}<br>{{VP|2|l}}
 +
|-
 +
| {{CardLangVersionImage|n=Harem}} || {{CardLangVersionImage|d=1|n=Harem}} || {{Cost|2|l}}{{Divline}}{{VP|2|l}}
 +
|}
 +
 
 +
== Backwards compatibility ==
 +
The following table shows legacy forms of how this template is used throughout the wiki.
 +
Changes to this template should be backwards compatible to these legacy forms.
 +
Otherwise one has to update all instances over the whole wiki or accept broken styles.
 +
 
 +
{| class="wikitable" style="text-align:center;"
 +
! Legacy form !! style="width: 100px" | Rendered !! style="width: 100px" | Recommended
 +
|-
 +
| <pre>5{{VP}}</pre> || 5{{VP}} || {{VP|5}}
 +
|-
 +
| <pre>{{nowrap|5{{VP}}}}</pre> || {{nowrap|5{{VP}}}} || {{VP|5}}
 +
|-
 +
| <pre>'''5'''{{VP}}</pre> || '''5'''{{VP}} || {{VP|'''5'''}}
 +
|-
 +
| <pre>'''5{{VP}}'''</pre> || '''5{{VP}}''' || {{VP|'''5'''}}
 +
|-
 +
| <pre>{{nowrap|'''5'''{{VP}}}}</pre> || {{nowrap|'''5'''{{VP}}}} || {{VP|'''5'''}}
 +
|-
 +
| <pre>{{VP|'''5'''|l}}</pre> || {{VP|'''5'''|l}} || {{VP|5|l}}
 +
|-
 +
| <pre>'''{{VP|5|l}}'''</pre> || '''{{VP|5|l}}''' || {{VP|5|l}}
 +
|-
 +
| <pre>{{nowrap|{{VP|'''5'''|l}}}}</pre> || {{nowrap|{{VP|'''5'''|l}}}} || {{VP|5|l}}
 +
|}

Revision as of 12:19, 21 August 2022

This template may be used to display the icon for Victory points.

Contents

Usage

{{VP|amount|size}}

DO use the template like in one of the following ways. To achieve a consistent styling and line breaking behavior all other forms are not recommended.

{{VP}}
{{VP|5}}
{{VP|'''5'''}}
{{VP|+5}}
{{VP|'''+5'''}}
{{VP|5|m}}
{{VP|5|l}}
{{VP|5|xl}}

Parameters

Optional

amount 
The amount of Victory points. Is displayed as number in front of the icon in proper size.
size 
The size of icon and number. Supported sizes: m, l, xl. If omitted it is considered to be displayed inline with text.

Implementation details

  • amount is cleared of font styles to prevent outer styles to be effective (mainly italics).

Examples

The following examples represent the main use cases throughout the wiki.

Inline with text

Curse's most obvious penalty is that it gives you {{VP|-1}} at the end of the game.

Curse's most obvious penalty is that it gives you -1 VP at the end of the game.

Inside of infobox

Crumbling Castle
Crumbling Castle.jpg
Info
Cost $4
Type(s) Victory - Castle
Kingdom card? Yes
Set EmpiresEmpires icon.png
Illustrator(s) Julien Delval
Card text
1 VP
When you gain or trash this, +1VP and gain a Silver.
{{Infobox Card
 |name = Crumbling Castle
 |cost = 4
 |set = Empires
 |type1 = Victory
 |type2 = Castle
 |illustrator = Julien Delval
 |text = {{VP|1|l}}
 |text2 = When you gain or trash this, {{VP|'''+1'''}} and gain a Silver.
}}
Harem
Harem.jpg
Info
Cost $6
Type(s) Treasure - Victory
Kingdom card? Yes
Set IntrigueIntrigue icon.png
Illustrator(s) Maura Kalusky
Card text
$2
2 VP
{{Infobox Card
 |name = Harem
 |cost = 6
 |type1 = Treasure
 |type2 = Victory
 |illustrator = Maura Kalusky
 |text = {{Cost|2|l}}
 |text2 = {{VP|2|l}}
}}

Inside of version tables

{| class="wikitable" style="text-align:center;"
! Print !! Digital !! Text
|-
| {{CardVersionImage|Crumbling Castle}} || {{CardVersionImage|Crumbling CastleDigital}} || {{VP|1|l}}{{Divline}}When you gain or trash this, {{VP|'''+1'''}} and gain a Silver.
|}
Print Digital Text
{{{2}}} {{{2}}} 1 VP
When you gain or trash this, +1VP and gain a Silver.
{| class="wikitable" style="text-align:center;"
! Print !! Digital !! Text
|-
| {{CardLangVersionImage|o=1}} || {{CardLangVersionImage|d=1|o=1}} || style="padding:0px 30px;"| {{Cost|2|l}}<br>{{VP|2|l}}
|-
| {{CardLangVersionImage}} || {{CardLangVersionImage|d=1}} || {{Cost|2|l}}{{Divline}}{{VP|2|l}}
|}
Print Digital Text
Harem Harem from Shuffle iT $2
2 VP
Harem Harem from Shuffle iT $2
2 VP

Backwards compatibility

The following table shows legacy forms of how this template is used throughout the wiki. Changes to this template should be backwards compatible to these legacy forms. Otherwise one has to update all instances over the whole wiki or accept broken styles.

Legacy form Rendered Recommended
5{{VP}}
5VP 5 VP
{{nowrap|5{{VP}}}}
5VP 5 VP
'''5'''{{VP}}
5VP 5VP
'''5{{VP}}'''
5VP 5VP
{{nowrap|'''5'''{{VP}}}}
5VP 5VP
{{VP|'''5'''|l}}
5VP 5 VP
'''{{VP|5|l}}'''
5 VP 5 VP
{{nowrap|{{VP|'''5'''|l}}}}
5VP 5 VP
Personal tools
Namespaces

Variants
Views
Actions
Navigation
Toolbox