Template:Sandbox: Difference between revisions

imported>Samueldr
No edit summary
imported>Artturin
No edit summary
Line 1: Line 1:
<noinclude>
<noinclude>{{Template}}{{DISPLAYTITLE:Template:file}}
Testing ifs...
The contents of a file.
{{META Pipe Character}}


{{#if: | yes | no}} → no
== Usage ==


{{#if: string | yes | no}} → yes
<nowiki>{{file|filename|language|contents}}</nowiki>


{{#if:      | yes | no}} → no
See documentation about <code>&lt;syntaxhighlight></code> for supported languages.


{{Sandbox}}
<nowiki>{{file|default.nix|nix|&lt;nowiki>
</noinclude><includeonly></includeonly>
{...}
{
  # Comment
}
&lt;/nowiki>}}</nowiki>
 
== Example ==
 
<nowiki>{{file|main.c|c|
#include <stdio.h>
 
main( )
{
        printf("hello, world\n");
}
}}</nowiki>
 
<hr />
{{sandbox|main.c|c|
#include <stdio.h>
 
main( )
{
        printf("hello, world\n");
}
}}
<hr />
 
</noinclude><includeonly><div
  style="
    width: 0;
    height: 0;
    position: relative;
    top: 0.9em;
    left: 1em;
  "
 
{{#tag:pre|{{{filename|{{{1|{{META Error}}}}}}}}
|style=margin-bottom: 0; border-bottom:none; padding-bottom:1.6em; padding-left:2.7em; margin-top: 0;
}}{{#tag:syntaxhighlight|{{{contents|{{{3|{{META Error}}}}}}}}
|lang={{{lang|{{{2| }}}}}}
|style=margin-top: -1em;}}
</includeonly>