Difference between revisions of "Template talk:Function"
Ray Chason (talk | contribs) (My bad...) |
(what does version argument even do?) |
||
Line 14: | Line 14: | ||
This template can be used between <nowiki><ref></nowiki> and <nowiki></ref></nowiki> tags; be sure to include a <nowiki><references/></nowiki> tag.--[[User:Ray Chason|Ray Chason]] 20:25, 17 June 2007 (UTC) | This template can be used between <nowiki><ref></nowiki> and <nowiki></ref></nowiki> tags; be sure to include a <nowiki><references/></nowiki> tag.--[[User:Ray Chason|Ray Chason]] 20:25, 17 June 2007 (UTC) | ||
:The trouble was that I wasn't closing the noinclude section. The instructions are now on the template page where they belong.--[[User:Ray Chason|Ray Chason]] 20:41, 17 June 2007 (UTC) | :The trouble was that I wasn't closing the noinclude section. The instructions are now on the template page where they belong.--[[User:Ray Chason|Ray Chason]] 20:41, 17 June 2007 (UTC) | ||
+ | |||
+ | ==Effect of version argument== | ||
+ | |||
+ | This template accepts a <tt>version</tt> argument, but uses it only to decide whether to generate the category or not. It does not actually select a source code version. | ||
+ | |||
+ | Template expansion of <nowiki>{{function|attrib.c|acurrstr}}</nowiki>: | ||
+ | * <nowiki>[[Source:attrib.c#acurrstr|acurrstr]] in [[Source:attrib.c|attrib.c]][[Category: Pages with unversioned Function templates]] | ||
+ | </nowiki> | ||
+ | |||
+ | Template expansion of <nowiki>{{function|attrib.c|accurstr|version=NetHack 3.4.3}}</nowiki>: | ||
+ | * <nowiki>[[Source:attrib.c#acurrstr|acurrstr]] in [[Source:attrib.c|attrib.c]]</nowiki> | ||
+ | |||
+ | Looks like this template is useless for any version other than the version of <tt>Source:attrib.c</tt>, which is currently hard-coded to 3.6.1. | ||
+ | |||
+ | Am I reading this right? [[User:Furey|Furey]] ([[User talk:Furey|talk]]) 12:23, 27 June 2024 (UTC) |
Latest revision as of 12:23, 27 June 2024
Instructions for using this template
This template is meant to be used between <ref> and </ref> tags. It cannot use a <noinclude> tag. It is necessary to put the instructions on the talk page.
This template is meant to be used to link to the source code, in particular, to targets that are named. Use Template:Sourcecode to link to numbered lines.
The syntax is {{function|filename|functionname}}. For example:
{{function|attrib.c|acurrstr}}
expands to:
This template can be used between <ref> and </ref> tags; be sure to include a <references/> tag.--Ray Chason 20:25, 17 June 2007 (UTC)
- The trouble was that I wasn't closing the noinclude section. The instructions are now on the template page where they belong.--Ray Chason 20:41, 17 June 2007 (UTC)
Effect of version argument
This template accepts a version argument, but uses it only to decide whether to generate the category or not. It does not actually select a source code version.
Template expansion of {{function|attrib.c|acurrstr}}:
- [[Source:attrib.c#acurrstr|acurrstr]] in [[Source:attrib.c|attrib.c]][[Category: Pages with unversioned Function templates]]
Template expansion of {{function|attrib.c|accurstr|version=NetHack 3.4.3}}:
- [[Source:attrib.c#acurrstr|acurrstr]] in [[Source:attrib.c|attrib.c]]
Looks like this template is useless for any version other than the version of Source:attrib.c, which is currently hard-coded to 3.6.1.
Am I reading this right? Furey (talk) 12:23, 27 June 2024 (UTC)