Difference between revisions of "Template:Box Code"

From PaparazziUAV
Jump to navigation Jump to search
 
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>{{Template}}</noinclude>
<noinclude>{{Template}}
<includeonly>{| WIDTH="75%" cellpadding=0 cellspacing=0 style="background-color: #f2fff2; border: solid 1px #bfffbf;"  
 
| style="background-color: #c1ffc1; border: solid 1px #a0ffa0; border-bottom: 1px solid #888;" | <font size="-1">'''Code:''' {{{1}}}</font>  
This template takes two parameters.
 
* <code>filename</code> will be displayed as the filename of the code block
* <code>code</code> the code itself.
 
If you include the following:
<nowiki>{{Box Code|somefile.txt|
int main(){
    printf("hello!\n");
    return 0;
}
}}</nowiki>
 
It will result in the following:
 
{{Box Code|somefile.txt|
int main(){
    printf("hello!\n");
    return 0;
}
}}
</noinclude>
<includeonly>{| WIDTH="75%" cellpadding=0 cellspacing=0 style="background-color: #fff; border: solid 1px #000;"  
| style="background-color: #f9f9f9; border: 0px; border-bottom: solid 1px #000;" | <font size="-1">'''File:''' {{{1}}}</font>  
|-  
|-  
|
|
{{{2}}}
{{{2}}}
|}</includeonly>
|}</includeonly>

Latest revision as of 07:08, 8 January 2016


Note: This page is a template. It contains no Paparazzi related information but should be used as part of other articles. For more information, read Help:Templates.

Please do not experiment with this template, it could mess up all pages using this template.


This template takes two parameters.

  • filename will be displayed as the filename of the code block
  • code the code itself.

If you include the following:

{{Box Code|somefile.txt|
 int main(){
    printf("hello!\n");
    return 0;
 }
}}

It will result in the following:


File: somefile.txt
int main(){
   printf("hello!\n");
   return 0;
}