Difference between revisions of "Template:Citation/make link"

From Self-sufficiency
Jump to: navigation, search
m (1 revision)
(subroutine for citation/core)
(18 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{#if:{{{1|}}}
+
{{#switch:{{#titleparts:{{{1|}}}|2}}
  |[{{{1}}} {{{2}}}]
+
  |Http:/|Https:/|Ftp:/ = [{{{1}}} {{{2|}}}] <!-- its a regular url= or chapter-url= -->
  |{{{2}}}
+
  |None                = {{{2|}}} <!-- "none" used to stop chapter-url= from defaulting to url= -->
}}<noinclude><!--
+
|<!-- is empty-->    = {{{2|}}}          <!-- (nil) when editor did not define url= -->
  Code notes (here so that people /read/ it)
+
|#default            = [[:{{{1}}}|{{{2|}}}]] <!-- its internal, not an external link -->
  1. Parameter #2 is always nonempty when called from {{Citation/core}}.
+
}}<noinclude>
  2. It's up to {{Citation/core}} to stop italicized "'foo' & 'bar'" from becoming
+
{{documentation}}
    "'''foo' & 'bar'''". Citation/core does this by having a <nowiki></nowiki>
+
</noinclude>
    at both beginning and end of the call to this template. Since this is only
+
    needed once, it's more efficient to do it in {{Citation/core}} than here.
+
--></noinclude>
+

Revision as of 20:27, 25 July 2009