<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://sro.wiki/index.php?action=history&amp;feed=atom&amp;title=Template%3AWikipedia_Link%2FDocumentation</id>
	<title>Template:Wikipedia Link/Documentation - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://sro.wiki/index.php?action=history&amp;feed=atom&amp;title=Template%3AWikipedia_Link%2FDocumentation"/>
	<link rel="alternate" type="text/html" href="https://sro.wiki/index.php?title=Template:Wikipedia_Link/Documentation&amp;action=history"/>
	<updated>2026-04-04T15:23:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://sro.wiki/index.php?title=Template:Wikipedia_Link/Documentation&amp;diff=5042&amp;oldid=prev</id>
		<title>Guninvalid: /* How it works (the headache inducing code */ )</title>
		<link rel="alternate" type="text/html" href="https://sro.wiki/index.php?title=Template:Wikipedia_Link/Documentation&amp;diff=5042&amp;oldid=prev"/>
		<updated>2025-10-28T23:49:38Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;How it works (the headache inducing code: &lt;/span&gt; )&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:49, 28 October 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l13&quot;&gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;with (on wikipedia) linking to [[wikipedia:Wikilink]] in the first case, and [[wikipedia:Example]] in the second case.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;with (on wikipedia) linking to [[wikipedia:Wikilink]] in the first case, and [[wikipedia:Example]] in the second case.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==How it works (the headache inducing code==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==How it works (the headache inducing code&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;)&lt;/ins&gt;==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The exact code under the hood is actually pretty simple but it&amp;#039;s still a mess of symbols. But I can summarize it here.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The exact code under the hood is actually pretty simple but it&amp;#039;s still a mess of symbols. But I can summarize it here.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key sro_mediawiki:diff::1.12:old-5041:rev-5042 --&gt;
&lt;/table&gt;</summary>
		<author><name>Guninvalid</name></author>
	</entry>
	<entry>
		<id>https://sro.wiki/index.php?title=Template:Wikipedia_Link/Documentation&amp;diff=5041&amp;oldid=prev</id>
		<title>Guninvalid: documentation top/bottom</title>
		<link rel="alternate" type="text/html" href="https://sro.wiki/index.php?title=Template:Wikipedia_Link/Documentation&amp;diff=5041&amp;oldid=prev"/>
		<updated>2025-10-28T23:41:08Z</updated>

		<summary type="html">&lt;p&gt;documentation top/bottom&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:41, 28 October 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Documentation top}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This template took a slightly embarassing amount of time to make but it&amp;#039;s pretty easy to explain:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This template took a slightly embarassing amount of time to make but it&amp;#039;s pretty easy to explain:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l26&quot;&gt;Line 26:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 28:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Finally, we use &amp;lt;nowiki&amp;gt;}}&amp;lt;/nowiki&amp;gt; to close out the if block, &amp;lt;nowiki&amp;gt;]]&amp;lt;/nowiki&amp;gt; to close out the link, &amp;lt;nowiki&amp;gt;)&amp;lt;/nowiki&amp;gt; to close out the visible parentheses, &amp;lt;nowiki&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/nowiki&amp;gt; to close out the small text block, and &amp;lt;nowiki&amp;gt;&amp;lt;/includeonly&amp;gt;&amp;lt;/nowiki&amp;gt; to indicate the end of the relevant section.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Finally, we use &amp;lt;nowiki&amp;gt;}}&amp;lt;/nowiki&amp;gt; to close out the if block, &amp;lt;nowiki&amp;gt;]]&amp;lt;/nowiki&amp;gt; to close out the link, &amp;lt;nowiki&amp;gt;)&amp;lt;/nowiki&amp;gt; to close out the visible parentheses, &amp;lt;nowiki&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/nowiki&amp;gt; to close out the small text block, and &amp;lt;nowiki&amp;gt;&amp;lt;/includeonly&amp;gt;&amp;lt;/nowiki&amp;gt; to indicate the end of the relevant section.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;for &lt;/del&gt;documentation}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{documentation &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;bottom&lt;/ins&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key sro_mediawiki:diff::1.12:old-5035:rev-5041 --&gt;
&lt;/table&gt;</summary>
		<author><name>Guninvalid</name></author>
	</entry>
	<entry>
		<id>https://sro.wiki/index.php?title=Template:Wikipedia_Link/Documentation&amp;diff=5035&amp;oldid=prev</id>
		<title>Guninvalid: Created page with &quot;This template took a slightly embarassing amount of time to make but it&#039;s pretty easy to explain:  &lt;nowiki&gt;{{wl|Source text|Wikilink}}&lt;/nowiki&gt; &lt;nowiki&gt;{{wl|Example}}&lt;/nowiki&gt;  Renders as:  {{wl|Source text|Wikilink}} {{wl|Example}}  with (on wikipedia) linking to wikipedia:Wikilink in the first case, and wikipedia:Example in the second case.  ==How it works (the headache inducing code== The exact code under the hood is actually pretty simple but it&#039;s still a mes...&quot;</title>
		<link rel="alternate" type="text/html" href="https://sro.wiki/index.php?title=Template:Wikipedia_Link/Documentation&amp;diff=5035&amp;oldid=prev"/>
		<updated>2025-10-28T23:37:13Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;This template took a slightly embarassing amount of time to make but it&amp;#039;s pretty easy to explain:  &amp;lt;nowiki&amp;gt;{{wl|Source text|Wikilink}}&amp;lt;/nowiki&amp;gt; &amp;lt;nowiki&amp;gt;{{wl|Example}}&amp;lt;/nowiki&amp;gt;  Renders as:  {{wl|Source text|Wikilink}} {{wl|Example}}  with (on wikipedia) linking to &lt;a href=&quot;https://en.wikipedia.org/wiki/Wikilink&quot; class=&quot;extiw&quot; title=&quot;wikipedia:Wikilink&quot;&gt;wikipedia:Wikilink&lt;/a&gt; in the first case, and &lt;a href=&quot;https://en.wikipedia.org/wiki/Example&quot; class=&quot;extiw&quot; title=&quot;wikipedia:Example&quot;&gt;wikipedia:Example&lt;/a&gt; in the second case.  ==How it works (the headache inducing code== The exact code under the hood is actually pretty simple but it&amp;#039;s still a mes...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This template took a slightly embarassing amount of time to make but it&amp;#039;s pretty easy to explain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;{{wl|Source text|Wikilink}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;{{wl|Example}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Renders as:&lt;br /&gt;
&lt;br /&gt;
{{wl|Source text|Wikilink}}&lt;br /&gt;
{{wl|Example}}&lt;br /&gt;
&lt;br /&gt;
with (on wikipedia) linking to [[wikipedia:Wikilink]] in the first case, and [[wikipedia:Example]] in the second case.&lt;br /&gt;
&lt;br /&gt;
==How it works (the headache inducing code==&lt;br /&gt;
The exact code under the hood is actually pretty simple but it&amp;#039;s still a mess of symbols. But I can summarize it here.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;nowiki&amp;gt;&amp;lt;includeonly&amp;gt;&amp;lt;/nowiki&amp;gt; tags allow me to isolate the template to only the relevant section, and leave the rest under &amp;lt;nowiki&amp;gt;&amp;lt;noinclude&amp;gt;&amp;lt;/nowiki&amp;gt; so it doesn&amp;#039;t bother the rest of the template. So we only focus on the bit inside:&lt;br /&gt;
&lt;br /&gt;
Start with &amp;lt;nowiki&amp;gt;{{{1}}}&amp;lt;/nowiki&amp;gt;, which simply parrots back the first field, in these example case, &amp;quot;Source Text&amp;quot; and &amp;quot;Example&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Next, the &amp;lt;nowiki&amp;gt;&amp;lt;small&amp;gt;&amp;lt;/nowiki&amp;gt; small tag indicates that the tag should be in small text.&lt;br /&gt;
&lt;br /&gt;
Next, we open a link with &amp;lt;nowiki&amp;gt;[[wikipedia:&amp;lt;/nowiki&amp;gt;, indicating that we would like to make a cross-wiki link to an article on Wikipedia.&lt;br /&gt;
&lt;br /&gt;
Next, we use the &amp;lt;nowiki&amp;gt;{{#if {{{2|}}}|&amp;lt;/nowiki&amp;gt; block to test if the second field exists. If it does, we link to the second field. In the first case, this means we resolve the link to Wikilink, which we do with the second component: &amp;lt;nowiki&amp;gt;{{{2}}}&amp;lt;/nowiki&amp;gt;. If it does not exist, we assume that the link is the same in both places, so we simply link the link text, using &amp;lt;nowiki&amp;gt;{{{1}}}&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Finally, we use &amp;lt;nowiki&amp;gt;}}&amp;lt;/nowiki&amp;gt; to close out the if block, &amp;lt;nowiki&amp;gt;]]&amp;lt;/nowiki&amp;gt; to close out the link, &amp;lt;nowiki&amp;gt;)&amp;lt;/nowiki&amp;gt; to close out the visible parentheses, &amp;lt;nowiki&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/nowiki&amp;gt; to close out the small text block, and &amp;lt;nowiki&amp;gt;&amp;lt;/includeonly&amp;gt;&amp;lt;/nowiki&amp;gt; to indicate the end of the relevant section.&lt;br /&gt;
&lt;br /&gt;
{{for documentation}}&lt;/div&gt;</summary>
		<author><name>Guninvalid</name></author>
	</entry>
</feed>