Anonymous
×
Create a new article
Write your page title here:
We currently have 55 articles on SR5 Foundry VTT System Wiki. Type your article name above or click on one of the titles below and start writing!



SR5 Foundry VTT System Wiki

Template:Source/Documentation: Difference between revisions

(Created page with "<includeonly>Category:Categorization Template</includeonly> {{Template|src}} is used to create sourcebook references and categorize articles making them. It leverages {{Template|src/Text}} to generate the appropriate strings. ==Usage== It accepts one {{Parameter|mandatory|string}}, one {{Parameter|optional|string}}, and one {{Parameter|optional|named}}: * {{Code|1}} is a sourcebook abbreviation; valid options are listed in {{Template|src/Abbreviations}}. * {{Code|2}}...")
 
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>[[Category:Categorization Template]]</includeonly>
<includeonly>[[Category:Categorization Template]][[Category:Reference Template]]</includeonly>
{{Template|src}} is used to create sourcebook references and categorize articles making them. It leverages {{Template|src/Text}} to generate the appropriate strings.
{{Template|Source}} is used to create sourcebook references and categorize articles making them. It leverages {{Template|Source/Text}} to generate the appropriate strings.
==Usage==
==Usage==
It accepts one {{Parameter|mandatory|string}}, one {{Parameter|optional|string}}, and one {{Parameter|optional|named}}:
It accepts one {{Parameter|mandatory|string}}, one {{Parameter|optional|string}}, and one {{Parameter|optional|named}}:
* {{Code|1}} is a sourcebook abbreviation; valid options are listed in {{Template|src/Abbreviations}}.
* {{Code|1}} is a sourcebook abbreviation; valid options are listed in {{Template|Source/Abbreviations}}.
* {{Code|2}} is a page reference, typically a single integer or a range.
* {{Code|2}} is a page reference, typically a single integer or a range.
* {{code|ref}} (defaults unset) is used to turn it into a reference.
* {{code|ref}} (defaults unset) is used to turn it into a reference.
==Return==
==Return==
{{Code|<nowiki>{{src|sr5}}</nowiki>}} puts the article into the appropriate category, then returns: {{Return|{{src|sr5}}}}
{{Code|<nowiki>{{Source|sr5}}</nowiki>}} puts the article into the appropriate category, then returns: {{Return|{{Source|sr5}}}}


Adding the second parameter, e.g. {{Code|<nowiki>{{src|sr5|404}}</nowiki>}}, modifies the return: {{Return|{{src|sr5|404}}}}
Adding the second parameter, e.g. {{Code|<nowiki>{{Source|sr5|404}}</nowiki>}}, modifies the return: {{Return|{{Source|sr5|404}}}}


Setting {{code|ref}} to any value creates a reference with the first parameter and the value of {{code|ref}} combined into the reference name. If {{code|ref}} is included, the second parameter is ignored if included. For instance, {{Code|<nowiki><p>My name is sr5-404{{src|sr5|ref=404}}.<br />My name is also sr5-404{{src|sr5|ref=404}}.</p></nowiki>}} returns:
Setting {{code|ref}} to any value creates a reference with the first parameter and the value of {{code|ref}} combined into the reference name. If {{code|ref}} is included, the second parameter is ignored. For instance, {{Code|<nowiki><p>My name is sr5-404{{Source|sr5|ref=404}}.<br />My name is also sr5-404{{Source|sr5|ref=404}}.</p></nowiki>}} returns:
{{Return|<p>My name is sr5-404{{src|sr5|ref=404}}.<br />My name is also sr5-404{{src|sr5|ref=404}}.</p>
{{Return|My name is sr5-404{{Source|sr5|ref=404}}.<br />My name is also sr5-404{{Source|sr5|ref=404}}.}}
==References==
...and...
<references />}}
{{Return|<references group="sr" />}}

Latest revision as of 02:32, 7 December 2023

Template:Source is used to create sourcebook references and categorize articles making them. It leverages Template:Source/Text to generate the appropriate strings.

Usage

It accepts one mandatory string parameter, one optional string parameter, and one optional named parameter:

  • 1 is a sourcebook abbreviation; valid options are listed in Template:Source/Abbreviations.
  • 2 is a page reference, typically a single integer or a range.
  • ref (defaults unset) is used to turn it into a reference.

Return

{{Source|sr5}} puts the article into the appropriate category, then returns:

Adding the second parameter, e.g. {{Source|sr5|404}}, modifies the return:

Setting ref to any value creates a reference with the first parameter and the value of ref combined into the reference name. If ref is included, the second parameter is ignored. For instance, <p>My name is sr5-404{{Source|sr5|ref=404}}.<br />My name is also sr5-404{{Source|sr5|ref=404}}.</p> returns:

My name is sr5-404[sr 1].
My name is also sr5-404[sr 1].

...and...