Difference between revisions of "Ref"
From NEC Retro
(updated to match Sega Retro's version) |
|||
Line 1: | Line 1: | ||
− | <noinclude> | + | <includeonly>{{clearvar|refdomain|refshown|refdate|refarc}}{{#vardefine:quote|{{{quote|}}}}}{{#vardefine:refdomain|{{#explode:{{#explode:{{{1|}}}|//|1}}|/|0}}}}{{#switch:{{#var:refdomain}} |
+ | | web.archive.org={{#vardefine:refshown|htt{{#explode:{{{1|}}}|/htt|1}}}}{{#vardefine:refdate|{{#explode:{{{1|}}}|/|4}}}}{{#switch:{{#var:refdate}} | ||
+ | |*={{#vardefine:refarc|Wayback Machine}} | ||
+ | |{{#vardefine:refarc|Wayback Machine: {{#sub:{{#var:refdate}}|0|4}}-{{#sub:{{#var:refdate}}|4|2}}-{{#sub:{{#var:refdate}}|6|2}} {{#sub:{{#var:refdate}}|8|2}}:{{#sub:{{#var:refdate}}|10|2}}}} | ||
+ | }} | ||
+ | | archive.today | ||
+ | | archive.fo | ||
+ | | archive.is | ||
+ | | archive.li | ||
+ | | archive.md | ||
+ | | archive.ph | ||
+ | | archive.vn={{#vardefine:refshown|{{#if:{{{2|}}}|{{{2|}}}|{{{1|}}}}}}}{{#if:{{{2|}}}|{{#vardefine:refarc|archive.today}}|[[Category:archive.today reference without original link]]}} | ||
+ | | {{#vardefine:refshown|{{{1|}}}}} | ||
+ | }}{{#tag: ref | {{#if:{{#var:quote}}|"{{#var:quote}}", }}{{#ifeq:{{#sub:{{{1|}}}|0|1}}|[|{{{1|}}}|[{{{1|}}} {{formatRefLink|1={{#var:refshown}}}}]}} {{#if:{{#var:refarc}}|({{#var:refarc}})}}| name="{{{1|}}}{{{quote|}}}" | group="{{#if:{{{group|}}}|{{{group|}}}}}"}}{{#switch:{{lc:{{fileext|{{{1|}}}}}}} | ||
+ | | pdf=[[Category:External PDF reference]] | ||
+ | | txt=[[Category:External TXT reference]] | ||
+ | | jpg|jpeg|gif|png=[[Category:External JPEG reference]] | ||
+ | | cpp|hpp=[[Category:External source code references]] | ||
+ | }}{{RefSiteCheck|{{{1|}}}{{{2|}}}}}{{incvar|refcount}}{{clearvar|quote}}</includeonly><noinclude> | ||
==Usage== | ==Usage== | ||
<tt><nowiki>{{ref|http://necretro.org}}</nowiki></tt> returns {{ref|http://necretro.org}} | <tt><nowiki>{{ref|http://necretro.org}}</nowiki></tt> returns {{ref|http://necretro.org}} | ||
Line 14: | Line 32: | ||
<references/> | <references/> | ||
− | [[Category:NEC Retro templates]]</noinclude | + | [[Category:NEC Retro templates]]</noinclude> |
Revision as of 15:38, 29 December 2021
Usage
{{ref|http://necretro.org}} returns [1]
If the address contains an equals sign (=), add "1=" to the beginning of the address like so:
{{ref|1=http://necretro.org/index.php?title=Example}}
See also
- Template:Fileref for referencing files stored on the wiki and Retro CDN.
References
Since this template uses the <ref> tag, all pages that use this template will have an auto-generated references list appended to the end of the page. To prevent confusion, a <references/> tag should be added to the end of the page in a dedicated "References" section, such as this one.