Actions

Template

Difference between revisions of "Ref"

From NEC Retro

 
(added support for Ghostarchive)
 
(6 intermediate revisions by 3 users not shown)
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:Archived reference without original link]]}}
 +
| ghostarchive.org={{#vardefine:refshown|{{#if:{{{2|}}}|{{{2|}}}|{{{1|}}}}}}}{{#if:{{{2|}}}|{{#vardefine:refarc|Ghostarchive}}|[[Category:Archived reference without original link]]}}
 +
| hiddenpalace.org={{#vardefine:refshown|Hidden Palace: {{#replace:{{#explode:{{{1|}}}|/|3}}|_|<nowiki /> <nowiki />}}}}
 +
| tcrf.net={{#vardefine:refshown|The Cutting Room Floor: {{#replace:{{#explode:{{{1|}}}|/|3}}|_|<nowiki /> <nowiki />}}}}
 +
| {{#vardefine:refshown|{{{1|}}}}}
 +
}}{{#tag: ref | {{#if:{{#var:quote}}|"{{#var:quote}}",&nbsp;}}{{#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 a footnote symbol that looks like this:{{ref|http://necretro.org}}, and appends the website to the References section at the bottom of the page. If multiple references to the same URL are used in a single page, they will be combined into a single reference.
  
If the address contains an equals sign (=), add "1=" to the beginning of the address like so:
+
If the address contains an equals sign [=], add "1=" to the beginning of the address like so:
  
 
<tt><nowiki>{{ref|</nowiki>'''1='''<nowiki>http://necretro.org/index.php?title=Example}}</nowiki></tt>
 
<tt><nowiki>{{ref|</nowiki>'''1='''<nowiki>http://necretro.org/index.php?title=Example}}</nowiki></tt>
 +
 +
If the address is an archive.today or Ghostarchive link, add the original URL as a second parameter after the archive.today URL like so (add "2=" to the start of the second parameter if the URL contains an equals sign):
 +
 +
<tt><nowiki>{{ref|https://archive.is/12345|http://necretro.org}}</nowiki></tt><br>
 +
<tt><nowiki>{{ref|https://ghostarchive.org/archive/12345|http://necretro.org}}</nowiki></tt>
  
 
==See also==
 
==See also==
 +
* [[Template:Intref]] for referencing other pages on the wiki and other Retro wikis.
 
* [[Template:Fileref]] for referencing files stored on the wiki and Retro CDN.
 
* [[Template:Fileref]] for referencing files stored on the wiki and Retro CDN.
 +
* [[Template:Magref]] for referencing magazines.
 +
 +
==Examples==
 +
*{{ref|http://www.google.com|quote=this is a quote}}
 +
*{{ref|https://hiddenpalace.org/Air_Zonk_(Prototype)}}
 +
*{{ref|https://tcrf.net/Bomberman_(TurboGrafx-16)}}
  
 
==References==
 
==References==
Line 14: Line 47:
 
<references/>
 
<references/>
  
[[Category:NEC Retro templates]]</noinclude><includeonly>{{#tag: ref | {{{1}}} | name="{{{1}}}" | group="{{#if:{{{group|}}}|{{{group}}}|}}"}}{{#ifeq:{{#pos:{{{1}}}|.pdf}}|||[[Category:External PDF reference]]}}{{#ifeq:{{#pos:{{{1}}}|.PDF}}|||[[Category:External PDF reference]]}}{{#ifeq:{{#pos:{{{1}}}|.txt}}|||[[Category:External TXT reference]]}}{{#ifeq:{{#pos:{{{1}}}|.TXT}}|||[[Category:External TXT reference]]}}{{#ifeq:{{#pos:{{{1}}}|.jpg}}|||[[Category:External JPEG reference]]}}{{#ifeq:{{#pos:{{{1}}}|.JPG}}|||[[Category:External JPEG reference]]}}{{#ifeq:{{#pos:{{{1}}}|.jpeg}}|||[[Category:External JPEG reference]]}}{{#ifeq:{{#pos:{{{1}}}|.JPEG}}|||[[Category:External JPEG reference]]}}{{#ifeq:{{#pos:{{{1}}}|.cpp}}|||[[Category:External source code references]]}}{{#ifeq:{{#pos:{{{1}}}|.hpp}}|||[[Category:External source code references]]}}</includeonly>
+
[[Category:Templates]]</noinclude>

Latest revision as of 12:59, 3 August 2023

Usage

{{ref|http://necretro.org}} returns a footnote symbol that looks like this:[1], and appends the website to the References section at the bottom of the page. If multiple references to the same URL are used in a single page, they will be combined into a single reference.

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}}

If the address is an archive.today or Ghostarchive link, add the original URL as a second parameter after the archive.today URL like so (add "2=" to the start of the second parameter if the URL contains an equals sign):

{{ref|https://archive.is/12345|http://necretro.org}}
{{ref|https://ghostarchive.org/archive/12345|http://necretro.org}}

See also

Examples

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.