Difference between revisions of "Template:Season/doc"

From Stardew Valley Wiki
Jump to navigation Jump to search
m (remove bullets (realized they could be misinterpreted as part of output))
 
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
This template displays the icon for the requested season, plus the season as a link to its associated article. One or more seasons may be specified, separated by commas.
+
==Description==
 
+
This template displays the icon for the requested season, plus the season as a link to its associated article.
The icon and text are enclosed in a nowrap span, so that they are always displayed on the same line.
 
  
 
==Notes==
 
==Notes==
The template recognizes two special values of season, <tt>Marriage</tt> and <tt>Deviations</tt>, for the sake of NPC schedule pages (see [[Template:ScheduleHeader]]).
+
The template recognizes two special values of season, <samp>Marriage</samp> and <samp>Deviations</samp>, for the sake of NPC schedule pages (see [[Template:ScheduleHeader]]).
 
 
==Usage==
 
===Syntax===
 
Basic usage:
 
<nowiki>{{</nowiki>[[Template:Season|Season]] | ''season'' <nowiki>}}</nowiki>
 
 
 
Complete argument list:
 
<nowiki>{{</nowiki>[[Template:Season|Season]] | ''season'' | size=''px'' | width=''widthpluspx'' | do_short=true
 
          | text_only=true | no_translate=true <nowiki>}}</nowiki>
 
 
 
===Parameters===
 
There is one unnamed, required parameter, ''season''.  All other parameters are named and optional.  Default value for all arguments is empty, unless specified otherwise.
 
 
 
* '''''season'''''
 
** First unnamed parameter, required
 
** The name of the season to be displayed, recognized values: <tt>Spring, Summer, Fall, Winter, All Seasons, Marriage, Deviations</tt>.  <tt>All</tt> and <tt>Any</tt> are recognized as synonyms for <tt>All Seasons</tt>.
 
** Multiple seasons can be specified, separated by commas
 
** If an unrecognized season name is provided, the template will simply print out that name (no link, no icon).
 
** The seasons should be provided as plain text (unlinked). However, to allow the template to work regardless of user input choices, links such as <tt><nowiki>[[Spring]]</nowiki></tt> will work. Also, if the <tt>''season''</tt> already contains any type of image link, the template will just return the input value unaltered (in case user input already included the season call, e.g., <tt><nowiki>{{Season|Spring}}</nowiki></tt>.
 
 
 
* '''size=''px'''''
 
** Size of icon in pixels.  Default value is 24
 
** Only the number should be provided (do not append "px").
 
 
 
* '''width=''widthpluspx'''''
 
** Size of icons in pixels ''with px'' (e.g., <nowiki>width=24px</nowiki>).
 
** This is redundant with <tt>size</tt> and inconsistent (expects a different format); only one (preferably <tt>size</tt>) should be used.
 
** This parameter is included solely for backwards compatibility and is deprecated
 
 
 
* '''do_short=true'''
 
** Relevant only if <tt>''season''</tt> is <tt>All Seasons</tt> (or a synonym): when <tt>do_short</tt> is set, <tt>All</tt> will be displayed instead of <tt>All Seasons</tt>
 
 
 
* '''text_only=true'''
 
** When set, return value is just the name of the season (no icon, no link), in wiki-specific language
 
** Allows other templates to use Template:Season for processing of generic season input data (especially on non-english wikis where translation capabilities may be wanted).
 
  
* '''no_translate=true'''
+
==Use==
** When set, any <tt>text_only</tt> return value is provided in English, instead of the wiki-specific language
+
<pre>{{Season|name of season|day (optional)|width (optional)}}</pre>
** Only relevant if <tt>text_only</tt> is set.
 
  
 
===Examples===
 
===Examples===
 
<pre>{{Season|Spring}}
 
<pre>{{Season|Spring}}
{{Season|Summer, Fall, Winter}}
 
 
{{Season|Marriage}}
 
{{Season|Marriage}}
 
{{Season|Deviations}}
 
{{Season|Deviations}}
{{Season|All|do_short=true}}
+
{{Season|All|width=48}}
{{Season|All|size=48}}</pre>
+
{{Season|Summer|24}}
 +
</pre>
  
Results:<br/>
+
Results:<br />
{{Season|Spring}}<br/>
+
{{Season|Spring}}<br />
{{Season|Summer, Fall, Winter}}<br/>
+
{{Season|Marriage}}<br />
{{Season|Marriage}}<br/>
+
{{Season|Deviations}}<br />
{{Season|Deviations}}<br/>
+
{{Season|All|width=48}}<br />
{{Season|All|do_short=true}}<br/>
+
{{Season|Summer|24}}<br />
{{Season|All|size=48}}
 
  
<includeonly>[[Category:Formatting templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude>
+
<includeonly>{{Addlanglinks}}[[Category:Templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude>

Latest revision as of 21:28, 8 January 2023

Description

This template displays the icon for the requested season, plus the season as a link to its associated article.

Notes

The template recognizes two special values of season, Marriage and Deviations, for the sake of NPC schedule pages (see Template:ScheduleHeader).

Use

{{Season|name of season|day (optional)|width (optional)}}

Examples

{{Season|Spring}}
{{Season|Marriage}}
{{Season|Deviations}}
{{Season|All|width=48}}
{{Season|Summer|24}}

Results:
Spring.png Spring
Mermaid's Pendant.png Marriage
Deviations
48 All
Summer.png 24 Summer