v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Difference between revisions of "Template:Wikisrc"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
(Examples)
(just use one <code> tag)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{#rreplace:{{{1}}}|(.)|<code>$1</code>}}<noinclude>
+
<includeonly><code>{{#rreplace:{{{1}}}|(.)|<span>$1</span>}}</code></includeonly><noinclude>
 
This displays the generated wiki source code ''before rendering'' (for debugging complex templates)
 
This displays the generated wiki source code ''before rendering'' (for debugging complex templates)
Example:
+
==Examples==
 
<pre>{{wikisrc|This is a [[link]].}}</pre>
 
<pre>{{wikisrc|This is a [[link]].}}</pre>
 
{{wikisrc|This is a [[link]].}}
 
{{wikisrc|This is a [[link]].}}
 
+
----
 
Note that templates are expanded:
 
Note that templates are expanded:
 +
<pre>{{wikisrc|{{av}}}}</pre>
 +
{{wikisrc|{{av}}}}
 
<pre>{{wikisrc|This is a [[link]] and a {{template}}}}</pre>
 
<pre>{{wikisrc|This is a [[link]] and a {{template}}}}</pre>
 
{{wikisrc|This is a [[link]] and a {{template}}}}
 
{{wikisrc|This is a [[link]] and a {{template}}}}
({{tl|template}} does not exist, so a link is produced to it instead.)
+
([[Template:template]] does not exist, so a link is produced to it instead.)
 
+
----
 
A recursive example:
 
A recursive example:
 
<pre>{{wikisrc|A {{wikisrc}} example}}</pre>
 
<pre>{{wikisrc|A {{wikisrc}} example}}</pre>
 
{{wikisrc|A {{wikisrc}} example}}
 
{{wikisrc|A {{wikisrc}} example}}
 
+
----
<pre>{{wikisrc|A {{wikisrc|A {{wikisrc}} example}} example}}</pre>
+
Another, more complex example (note that each character in the &lt;code> tags is surrounded by a &lt;span> tag)
 +
<pre>{{wikisrc|A {{wikisrc|An inner {{wikisrc}} inclusion}} example}}</pre>
 
{{wikisrc|A {{wikisrc|An inner {{wikisrc}} inclusion}} example}}
 
{{wikisrc|A {{wikisrc|An inner {{wikisrc}} inclusion}} example}}
  
 
</noinclude>
 
</noinclude>

Latest revision as of 02:49, 10 June 2019