Template:File: Difference between revisions
m Improve file name spacing |
No edit summary |
||
Line 1: | Line 1: | ||
<noinclude>{{Template}}{{DISPLAYTITLE:Template:file}} | <noinclude>{{Template}}{{DISPLAYTITLE:Template:file}} | ||
<templatedata> | |||
{ | |||
"description": "Brief description of what your template does", | |||
"params": { | |||
"file": { | |||
"label": "File", | |||
"description": "Description of what this file parameter is for", | |||
"type": "string", | |||
"required": true | |||
}, | |||
"option": { | |||
"label": "Option", | |||
"description": "Description of what this option does", | |||
"type": "string", | |||
"suggestedvalues": ["value1", "value2", "value3", "value4"], | |||
"required": false | |||
} | |||
} | |||
} | |||
</templatedata> | |||
== About == | == About == |
Revision as of 00:25, 3 June 2025
Please do not experiment with this template; you could ruin all pages using this template. If you want to edit this template, copy the text to Template:Sandbox, edit and test it there, and copy it back when it works.
Feel free to discuss this template in the talk page.
If you wanted to create a new page instead, use the search box to search for the title of the new page you want to create and follow the linkCreate the page "XYZ" on this wiki!
in the results page. An alternative is to create a dangling link to the new page from an existing page. A final option is to directly visit the expected URL of the page.Brief description of what your template does
Parameter | Description | Type | Status | |
---|---|---|---|---|
File | file | Description of what this file parameter is for | String | required |
Option | option | Description of what this option does
| String | optional |
About
Used to display contents of a file.
Special note
The pipe character cannot be used as is within the template, as it is a special characters for templates.
It can be included using the magic word {{!}}
.
Alternatively, it is possible to instead surround the contents in <nowiki>
tags.
Usage
{{file|filename|language|contents}}
See documentation about <syntaxhighlight>
for supported languages.
{{file|main.c|c| #include <stdio.h> main( ) { printf("hello, world\n"); } }}
Example

main.c
#include <stdio.h>
main( )
{
printf("hello, world\n");
}