Template:Sfn/doc:修订间差异

模板页面
添加的内容 删除的内容
无编辑摘要
(机器人:替换文本;整理源码)
 
第1行: 第1行:
{{Documentation subpage}}
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->


=短脚注模板=
= 短脚注模板 =
__TOC__
__TOC__
==目的==
== 目的 ==


于脚注中创建短的[[哈佛参考文献格式]]。
于脚注中创建短的[[哈佛参考文献格式]]。
第12行: 第11行:
*自动创建到页底该引用的具体信息的链接。锚点只有当你添加了{{para|ref=|harv}}参数到目的模板才会被创建。这个链接只有当参数{{para|last}}、{{para|last2}}和{{para|year}}与{{tl|sfn}}相匹配时才会被创建,或者{{para|ref}}被设置为一个其他的锚点id。
*自动创建到页底该引用的具体信息的链接。锚点只有当你添加了{{para|ref=|harv}}参数到目的模板才会被创建。这个链接只有当参数{{para|last}}、{{para|last2}}和{{para|year}}与{{tl|sfn}}相匹配时才会被创建,或者{{para|ref}}被设置为一个其他的锚点id。


==用法==
== 用法 ==


: <code><nowiki>{{</nowiki>Sfn |''Last name of author(s)''|''Year''| loc = ''Location in the text''}}</code>
: <code><nowiki>{{</nowiki>Sfn |''Last name of author(s)''|''Year''| loc = ''Location in the text''}}</code>
第36行: 第35行:
Editors editing this template are requested to consider making parallel changes to {{tl|Harv}}, {{tl|Harvnb}} and {{tl|Harvs}}.
Editors editing this template are requested to consider making parallel changes to {{tl|Harv}}, {{tl|Harvnb}} and {{tl|Harvs}}.


==例子==
== 例子 ==


:{| class="wikitable"
:{| class="wikitable"
第172行: 第171行:
|}
|}


==Anchor IDs==
== Anchor IDs ==
This template generates an HTML IDd as an anchor to link the short citation to the full citation.. The {{para|ref|harv}} field is necessary in each of the <code><nowiki>{{cite ...}}</nowiki></code> templates to enable the id. The {{tl|citation}} template always generates an id.
This template generates an HTML IDd as an anchor to link the short citation to the full citation.. The {{para|ref|harv}} field is necessary in each of the <code><nowiki>{{cite ...}}</nowiki></code> templates to enable the id. The {{tl|citation}} template always generates an id.


第183行: 第182行:


Where ''cite_name'' is a name such as the publisher, and must follow these rules:
Where ''cite_name'' is a name such as the publisher, and must follow these rules:
* Must begin with a letter A-Z or a-z
* Must begin with a letter A-Z or a-z
* Can be followed by: letters (A-Za-z), digits (0-9), hyphens ("-"), underscores ("_"), colons (":"), and periods (".")
* Can be followed by: letters (A-Za-z), digits (0-9), hyphens ("-"), underscores ("_"), colons (":"), and periods (".")
* Spaces in the {{para|ref}} field must be replaced with underscores
* Spaces in the {{para|ref}} field must be replaced with underscores
* Case-sensitive
* Case-sensitive


===SfnRef===
=== SfnRef ===
You may use the {{tl|SfnRef}} template to generate the proper value for the {{para|ref}} parameter. Pass the same parameters used with {{tl|sfn}} to {{tl|SfnRef}}:
You may use the {{tl|SfnRef}} template to generate the proper value for the {{para|ref}} parameter. Pass the same parameters used with {{tl|sfn}} to {{tl|SfnRef}}:
: <code><nowiki>{{sfn|</nowiki>''cite name''|''year''<nowiki>}}</nowiki></code>
: <code><nowiki>{{sfn|</nowiki>''cite name''|''year''<nowiki>}}</nowiki></code>
第195行: 第194行:
Articles using {{tlx|sfn}} should be checked for duplicate IDs with the [http://validator.w3.org/ W3C Markup Validation Service].
Articles using {{tlx|sfn}} should be checked for duplicate IDs with the [http://validator.w3.org/ W3C Markup Validation Service].


==注意==
== 注意 ==
使用sfn模板時,無需在前後加上<nowiki><ref>和</ref></nowiki>,例如
使用sfn模板時,無需在前後加上<nowiki><ref>和</ref></nowiki>,例如
<pre>{{sfn|Smith|2006|p=26}}</pre>等於如下原始碼:<pre><ref name=Smith200626>{{Harvnb|Smith|2006|p=26}}</ref></pre>
<pre>{{sfn|Smith|2006|p=26}}</pre>等於如下原始碼:<pre><ref name=Smith200626>{{Harvnb|Smith|2006|p=26}}</ref></pre>


==TemplateData==
== TemplateData ==
{{TemplateDataHeader}}
{{TemplateDataHeader}}
<templatedata>
<templatedata>