틀:Source code ref/doc
This template can be used to mark information as being taken from Terraria's source code. It prints a short, modifiable text wrapped in a <ref>
tag.
Usage
{{source code ref | v = <current version> | <further comments> | method = <method name(s)> | noref = y/yes | name = <custom <ref> name> }}
- v
Set it to the version of Terraria from which the information was taken. This is important because the game and source code change over time, and it helps identifying potentially outdated information in future updates.
- First unnamed parameter
Can be used to add further comments, like method names or other specifications.
- method
If there is a specific method that the information was taken from, its name (including full namespace) can be passed to this parameter. This is useful for an automatic, standardized formatting and localization. Multiple method names can be passed as well, separated by a slash (
). The first unnamed parameter always takes precedence over this parameter.
/
- noref
Set to
/y
to suppress the yes
<ref>
tag.
- name
Can be used to specify a custom name for the <ref>, so that a <ref> can be reused several times (via <ref name="<name>" />
). Only has an effect if
is not set.
$noref
Notes
- Although all parameters are optional,
should always be set.$v
- If the version passed in
is different from the current Desktop version (determined via$v
{{version|desktop}}
), a note will be appended. The page will furthermore be categorized in Category:Pages with information based on outdated versions of Terraria's source code. - If there is at least one call of
{{source code ref}}
without
on the page, a new section "References" or "Footnotes" with {{reflist}} needs to be added.$noref
Examples
Code | Result |
---|---|
{{source code ref|v=틀:V|noref=y}} |
틀:Source code ref |
{{source code ref|v=1.3.0.1|noref=y}} |
틀:Source code ref |
{{source code ref|v=틀:V|the first block in method {{code|Foo()}} in {{code|Bar.cs}}.|noref=y}} |
틀:Source code ref |
{{source code ref|v=틀:V|method=Bar.Foo / Lorem.Ipsum.Dolor / Bar.Bas|noref=y}} |
틀:Source code ref |
The thing takes three seconds to be done in Classic Mode and six seconds in Expert Mode.{{source code ref|v=1.3.0.1|method=Bar.Foo}} |
The thing takes three seconds to be done in Classic Mode and six seconds in Expert Mode.틀:Source code ref |
References
- 구식 enclose 속성을 사용하는 문서
- Pages using DynamicPageList3 parser function
- Pages using DynamicPageList3 dplreplace parser function
- Pages using DynamicPageList3 dplvar parser function
- Template documentation