Difference between revisions of "Template:Citelink"

From PC-BSD Wiki
Jump to: navigation, search
(Explanation)
m (Changed protection level for "Template:Citelink": Template security (‎[edit=autoconfirmed] (indefinite) ‎[move=sysop] (indefinite)))
 
(43 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<onlyinclude><span class="plainlinks">[{{template:ourInterwiki|first={{{1|}}}}}{{{url|{{{2|{{{1|}}}}}}}}} {{{txt|{{{3|{{{2|{{{1|}}}}}}}}}}}}]</span>{{#tag:ref|{{ourInterwiki|first={{{1}}}}}{{{url|{{{2|}}}}}}|name="{{ourInterwiki|first={{{1}}}}}{{{url|{{{2|{{{1}}}}}}}}}"}}</onlyinclude><noinclude> <!-- above works as is. do not adjust -->
+
<includeonly><span class="plainlinks">{{#if: {{{txtAb|}}}|[{{ourInterwiki|first={{{1|}}}}} {{{txtAb|}}}]{{#tag:ref|{{ourInterwiki|first={{{1}}}}}|name="{{ourInterwiki|first={{{1}}}}}"}}|[{{ourInterwiki|first={{{1|}}}}}{{{url|}}} {{{txt|}}}]{{#tag:ref|{{ourInterwiki|first={{{1}}}}}{{{url|}}}|name="{{ourInterwiki|first={{{1}}}}}{{{url|{{{1|}}}}}}"}}}}</span></includeonly><noinclude>
 
== Explanation ==  
 
== Explanation ==  
  
 
This template exists to simplify addition of a footnote feature within the handbook pages, to reduce the work needed when the handbook wiki is published into the ''dead tree'' version. It may also facilitate verification of all external links except that this assumes that all external links (of both types below) are in the wiki using this template. In addition, the links are made 'simple' which means there will only be the subscripted numeral within square brackets, and no square with upper-right pointing arrow symbol.
 
This template exists to simplify addition of a footnote feature within the handbook pages, to reduce the work needed when the handbook wiki is published into the ''dead tree'' version. It may also facilitate verification of all external links except that this assumes that all external links (of both types below) are in the wiki using this template. In addition, the links are made 'simple' which means there will only be the subscripted numeral within square brackets, and no square with upper-right pointing arrow symbol.
  
== Implementation - 1st part ==
+
== {{highlight|text=Implementation 1st part}} ==
  
 
The ''Citelink'' template method to satisfy the per-link part.
 
The ''Citelink'' template method to satisfy the per-link part.
Line 13: Line 13:
 
:: For the link use '''<nowiki>{{Citelink|url=</nowiki>'''''complete URL'''''|txt='''''alternate text'''''}}'''
 
:: For the link use '''<nowiki>{{Citelink|url=</nowiki>'''''complete URL'''''|txt='''''alternate text'''''}}'''
  
=== Special External ===
+
=== Special External (standard) ===
  
 
: The URL is for a site not part of the PC-BSD wiki, but has a defined ''shortcut'' such as for wikipedia.
 
: The URL is for a site not part of the PC-BSD wiki, but has a defined ''shortcut'' such as for wikipedia.
 
: '''<nowiki>{{Citelink|</nowiki>'''''shortcut'''''|url='''''page URL'''''|txt='''''alternate text'''''}}'''
 
: '''<nowiki>{{Citelink|</nowiki>'''''shortcut'''''|url='''''page URL'''''|txt='''''alternate text'''''}}'''
::'''Example:''' <nowiki>[http://en.wikipedia.org/wiki/faq/ faq on wikipedia]</nowiki> '''becomes''' <nowiki>{{citelink|wikipedia|url=faq|faq on wikipedia}}</nowiki>
+
 
 +
::'''Example:''' <nowiki>[http://en.wikipedia.org/wiki/faq/ faq on wikipedia]</nowiki> '''becomes''' <nowiki>{{citelink|wikipedia|url=faq|txt=faq on wikipedia}}</nowiki> '''and appears as''' {{citelink|wikipedia|url=faq|txt=faq on wikipedia}}
 +
 
 +
=== Special External (abbreviation) ===
 +
: The URL would otherwise be obscenely long especially due to defining languages the external site has localized.
 +
:'''<nowiki>{{Citelink|</nowiki>'''''shortcut'''''|txtAb='''''alternate text'''''}}'''
 +
 
 +
:'''Example of abbreviation use:'''
 +
:::<nowiki>[https://creativecommons.org/licenses/by/3.0/deed.en Creative Commons]</nowiki>
 +
::'''would be (properly including localization)'''
 +
:::<nowiki>{{citelink|url=https://creativecommons.org/licenses/by/3.0/deed{{testLangURL|es|es_ES|ca|de|eo|fr|id|it|hu|no|nl|pl|pt|pt_BR|fi|sv|is|el|ru|uk|zh|zh_TW|ko}}|txt=Creative Commons}}</nowiki>
 +
::'''but due to txtAb is now'''
 +
:::<nowiki>{{citelink|ccby3|txtAb=Creative Commons}}</nowiki>
  
 
==== Current defined shortcuts ====
 
==== Current defined shortcuts ====
 +
Where a localized page exists (shown below with iso code of ''en'' within the URL) it will match the language of a localized PC-BSD wiki page it appears on. Some URLs have multiple keywords associated with them.
 
<code>
 
<code>
 +
:        {{padright:ccby3 -|15|-}} {{https}}creativecommons.org/licenses/by/3.0/deed.en
 
:      {{padright:commons -|15|-}} {{http}}commons.wikimedia.org/wiki/
 
:      {{padright:commons -|15|-}} {{http}}commons.wikimedia.org/wiki/
:          {{padright:fbsd -|15|-}} {{http}}wiki.freebsd.org/
 
 
:        {{padright:fbsddh -|15|-}} {{http}}www.freebsd.org/doc/en/books/developers-handbook/
 
:        {{padright:fbsddh -|15|-}} {{http}}www.freebsd.org/doc/en/books/developers-handbook/
 
:        {{padright:fbsdh -|15|-}} {{http}}www.freebsd.org/doc/en/books/handbook/
 
:        {{padright:fbsdh -|15|-}} {{http}}www.freebsd.org/doc/en/books/handbook/
:        {{padright:fbsdph -|15|-}} {{http}}/www.freebsd.org/doc/en/books/porters-handbook/
+
:        {{padright:fbsdhp -|15|-}} {{http}}www.freebsd.org/
:           {{padright:mw -|15|-}} {{http}}www.mediawiki.org/wiki/
+
:        {{padright:fbsdph -|15|-}} {{http}}www.freebsd.org/doc/en/books/porters-handbook/
 +
:         {{padright:fbsdw -|15|-}} {{http}}wiki.freebsd.org/
 +
:        {{padright:ffbsd -|15|-}} {{http}}forums.freebsd.org/
 +
:        {{padright:fpcbsd -|15|-}} {{http}}forums.pcbsd.org/
 +
:      {{padright:fdpcbsd -|15|-}} {{http}}forums.pcbsd.org/forumdisplay.php?f=
 +
:      {{padright:manpage -|15|-}} {{http}}www.freebsd.org/cgi/man.cgi?query=
 
: {{padright:mediawikiwiki -|15|-}} {{http}}www.mediawiki.org/wiki/
 
: {{padright:mediawikiwiki -|15|-}} {{http}}www.mediawiki.org/wiki/
 
:    {{padright:mediazilla -|15|-}} {{http}}bugzilla.wikimedia.org/
 
:    {{padright:mediazilla -|15|-}} {{http}}bugzilla.wikimedia.org/
 
:          {{padright:meta -|15|-}} {{http}}meta.wikimedia.org/wiki/
 
:          {{padright:meta -|15|-}} {{http}}meta.wikimedia.org/wiki/
 +
:            {{padright:mw -|15|-}} {{http}}www.mediawiki.org/wiki/
 +
:      {{padright:pcbsdhp -|15|-}} {{http}}www.pcbsd.org/en/
 +
:    {{padright:pcbsdlist -|15|-}} {{http}}lists.pcbsd.org/mailman/listinfo/
 +
:    {{padright:pcbsdlists -|15|-}} {{http}}lists.pcbsd.org/mailman/listinfo/
 
:          {{padright:trac -|15|-}} {{http}}trac.pcbsd.org/wiki/
 
:          {{padright:trac -|15|-}} {{http}}trac.pcbsd.org/wiki/
 +
:        {{padright:tracpo -|15|-}} {{http}}trac.pcbsd.org/browser/build-files/ports-overlay/
 
:    {{padright:wikibooks -|15|-}} {{http}}en.wikibooks.org/wiki/
 
:    {{padright:wikibooks -|15|-}} {{http}}en.wikibooks.org/wiki/
 
:    {{padright:wikimedia -|15|-}} {{http}}wikimediafoundation.org/wiki/
 
:    {{padright:wikimedia -|15|-}} {{http}}wikimediafoundation.org/wiki/
Line 38: Line 61:
 
:  {{padright:wikispecies -|15|-}} {{http}}species.wikimedia.org/wiki/
 
:  {{padright:wikispecies -|15|-}} {{http}}species.wikimedia.org/wiki/
 
:    {{padright:wiktionary -|15|-}} {{http}}en.wiktionary.org/wiki/
 
:    {{padright:wiktionary -|15|-}} {{http}}en.wiktionary.org/wiki/
:            {{padright:wp -|15|-}} {{http}}en.wikipedia.org/wiki/
 
 
:    {{padright:wikipedia -|15|-}} {{http}}en.wikipedia.org/wiki/
 
:    {{padright:wikipedia -|15|-}} {{http}}en.wikipedia.org/wiki/
:  {{padright:wikiversity -|15|-}} {{http}}en.wikiversity.org/wiki/ <!-- OurInterwiki template cannot transclude here. -->
+
:  {{padright:wikiversity -|15|-}} {{http}}en.wikiversity.org/wiki/
 +
:            {{padright:wp -|15|-}} {{http}}en.wikipedia.org/wiki/
 +
<!-- OurInterwiki template cannot transclude here, and attempts to do so only break things: Don't! -->
 
</code>
 
</code>
  
== Implementation - 2nd part ==
+
== Implementation 2nd part ==
  
The ''refheading'' template method to satisfy the per-page part.
+
The [[template:refheading|''refheading'' template]] method to satisfy the per-page part.
: Place one '''<<nowiki>noinclude>{{refheading}}</noinclude</nowiki>>''' at the bottom of the page, above the category links section.
+
: Place one '''<<nowiki>noinclude>{{</nowiki>refheading<nowiki>}}</noinclude</nowiki>>''' at the bottom of the page, above the category links section.
:* A large red text warning message which mentions <nowiki><ref></nowiki> is automatically generated by the wiki when the second half of the setup is missing.
+
:* When citelink is used on the page but the refheading is missing, a large red text warning message which mentions <nowiki><ref></nowiki> is automatically generated by the wiki as below:
  
 
[[Category:templates]]</noinclude>
 
[[Category:templates]]</noinclude>

Latest revision as of 00:18, 20 December 2013

Contents

[edit] Explanation

This template exists to simplify addition of a footnote feature within the handbook pages, to reduce the work needed when the handbook wiki is published into the dead tree version. It may also facilitate verification of all external links except that this assumes that all external links (of both types below) are in the wiki using this template. In addition, the links are made 'simple' which means there will only be the subscripted numeral within square brackets, and no square with upper-right pointing arrow symbol.

[edit] Implementation — 1st part

The Citelink template method to satisfy the per-link part.

[edit] External

The URL is for a location outside of wiki.pcbsd.org.
For the link use {{Citelink|url=complete URL|txt=alternate text}}

[edit] Special External (standard)

The URL is for a site not part of the PC-BSD wiki, but has a defined shortcut such as for wikipedia.
{{Citelink|shortcut|url=page URL|txt=alternate text}}
Example: [http://en.wikipedia.org/wiki/faq/ faq on wikipedia] becomes {{citelink|wikipedia|url=faq|txt=faq on wikipedia}} and appears as faq on wikipedia[1]

[edit] Special External (abbreviation)

The URL would otherwise be obscenely long especially due to defining languages the external site has localized.
{{Citelink|shortcut|txtAb=alternate text}}
Example of abbreviation use:
[https://creativecommons.org/licenses/by/3.0/deed.en Creative Commons]
would be (properly including localization)
{{citelink|url=https://creativecommons.org/licenses/by/3.0/deed{{testLangURL|es|es_ES|ca|de|eo|fr|id|it|hu|no|nl|pl|pt|pt_BR|fi|sv|is|el|ru|uk|zh|zh_TW|ko}}|txt=Creative Commons}}
but due to txtAb is now
{{citelink|ccby3|txtAb=Creative Commons}}

[edit] Current defined shortcuts

Where a localized page exists (shown below with iso code of en within the URL) it will match the language of a localized PC-BSD wiki page it appears on. Some URLs have multiple keywords associated with them.

ccby3 --------- https://creativecommons.org/licenses/by/3.0/deed.en
commons ------- http://commons.wikimedia.org/wiki/
fbsddh -------- http://www.freebsd.org/doc/en/books/developers-handbook/
fbsdh --------- http://www.freebsd.org/doc/en/books/handbook/
fbsdhp -------- http://www.freebsd.org/
fbsdph -------- http://www.freebsd.org/doc/en/books/porters-handbook/
fbsdw --------- http://wiki.freebsd.org/
ffbsd --------- http://forums.freebsd.org/
fpcbsd -------- http://forums.pcbsd.org/
fdpcbsd ------- http://forums.pcbsd.org/forumdisplay.php?f=
manpage ------- http://www.freebsd.org/cgi/man.cgi?query=
mediawikiwiki - http://www.mediawiki.org/wiki/
mediazilla ---- http://bugzilla.wikimedia.org/
meta ---------- http://meta.wikimedia.org/wiki/
mw ------------ http://www.mediawiki.org/wiki/
pcbsdhp ------- http://www.pcbsd.org/en/
pcbsdlist ----- http://lists.pcbsd.org/mailman/listinfo/
pcbsdlists ---- http://lists.pcbsd.org/mailman/listinfo/
trac ---------- http://trac.pcbsd.org/wiki/
tracpo -------- http://trac.pcbsd.org/browser/build-files/ports-overlay/
wikibooks ----- http://en.wikibooks.org/wiki/
wikimedia ----- http://wikimediafoundation.org/wiki/
wikinews ------ http://en.wikinews.org/wiki/
wikiquote ----- http://en.wikiquote.org/wiki/
wikisource ---- http://wikisource.org/wiki/
wikispecies --- http://species.wikimedia.org/wiki/
wiktionary ---- http://en.wiktionary.org/wiki/
wikipedia ----- http://en.wikipedia.org/wiki/
wikiversity --- http://en.wikiversity.org/wiki/
wp ------------ http://en.wikipedia.org/wiki/

[edit] Implementation — 2nd part

The refheading template method to satisfy the per-page part.

Place one <noinclude>{{refheading}}</noinclude> at the bottom of the page, above the category links section.
  • When citelink is used on the page but the refheading is missing, a large red text warning message which mentions <ref> is automatically generated by the wiki as below:

Cite error: <ref> tags exist, but no <references/> tag was found