Difference between revisions of "Template:Wikisrc"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
m (Examples: +)
(just use one <code> tag)
 
Line 1: Line 1:
<includeonly>{{#rreplace:{{{1}}}|(.)|<code>$1</code>}}</includeonly><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)
 
==Examples==
 
==Examples==
Line 16: Line 16:
 
{{wikisrc|A {{wikisrc}} example}}
 
{{wikisrc|A {{wikisrc}} example}}
 
----
 
----
Another, more complex example (note that each character in the &lt;code> tags is surrounded by a &lt;code> tag)
+
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>
 
<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

This displays the generated wiki source code before rendering (for debugging complex templates)

Examples[edit]

{{wikisrc|This is a [[link]].}}

This is a [[link]].


Note that templates are expanded:

{{wikisrc|{{av}}}}

<table class="version-table" style="text-align: center; margin: 0 auto; padding: 0.25em; padding-top:1em; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; -o-border-radius: 3px; -ms-border-radius: 3px;; border: 2px solid #99ddff; background: #eef5ff; min-width:27em"><tr><td style="padding: 0.3em 0.3em; width: 100%;"><span>This article is in the template namespace.</span><br>

<div style="float: right; font-size:75%; padding-right:2px; margin-top:-2px; margin-bottom:-7px;"><span class="version-link">[[Template:av|<span style='text-decoration: none; color: #0088CC; '>More Info</span>]]</span></div></td></tr> </table>

{{wikisrc|This is a [[link]] and a {{template}}}}

This is a [[link]] and a [[:Template:Template]] (Template:template does not exist, so a link is produced to it instead.)


A recursive example:

{{wikisrc|A {{wikisrc}} example}}

A <code><span>{</span><span>{</span><span>{</span><span>1</span><span>}</span><span>}</span><span>}</span></code> example


Another, more complex example (note that each character in the <code> tags is surrounded by a <span> tag)

{{wikisrc|A {{wikisrc|An inner {{wikisrc}} inclusion}} example}}

A <code><span>A</span><span>n</span><span> </span><span>i</span><span>n</span><span>n</span><span>e</span><span>r</span><span> </span><span><</span><span>c</span><span>o</span><span>d</span><span>e</span><span>></span><span><</span><span>s</span><span>p</span><span>a</span><span>n</span><span>></span><span>{</span><span><</span><span>/</span><span>s</span><span>p</span><span>a</span><span>n</span><span>></span><span><</span><span>s</span><span>p</span><span>a</span><span>n</span><span>></span><span>{</span><span><</span><span>/</span><span>s</span><span>p</span><span>a</span><span>n</span><span>></span><span><</span><span>s</span><span>p</span><span>a</span><span>n</span><span>></span><span>{</span><span><</span><span>/</span><span>s</span><span>p</span><span>a</span><span>n</span><span>></span><span><</span><span>s</span><span>p</span><span>a</span><span>n</span><span>></span><span>1</span><span><</span><span>/</span><span>s</span><span>p</span><span>a</span><span>n</span><span>></span><span><</span><span>s</span><span>p</span><span>a</span><span>n</span><span>></span><span>}</span><span><</span><span>/</span><span>s</span><span>p</span><span>a</span><span>n</span><span>></span><span><</span><span>s</span><span>p</span><span>a</span><span>n</span><span>></span><span>}</span><span><</span><span>/</span><span>s</span><span>p</span><span>a</span><span>n</span><span>></span><span><</span><span>s</span><span>p</span><span>a</span><span>n</span><span>></span><span>}</span><span><</span><span>/</span><span>s</span><span>p</span><span>a</span><span>n</span><span>></span><span><</span><span>/</span><span>c</span><span>o</span><span>d</span><span>e</span><span>></span><span> </span><span>i</span><span>n</span><span>c</span><span>l</span><span>u</span><span>s</span><span>i</span><span>o</span><span>n</span></code> example