Template:File: Difference between revisions

DoggoBit (talk | contribs)
No edit summary
DoggoBit (talk | contribs)
m make params consistent
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>{{Template}}{{DISPLAYTITLE:Template:file}}
<includeonly><div><div style="
 
  background-color: var(--background-color-neutral-subtle);
<templatedata>
  line-height: 1.3;
{
  font-family: monospace;
    "description": "Brief description of what your template does",
  padding: 0.5em 1em;
    "params": {
  border-top-left-radius: 0.3rem;
        "file": {
  border-top-right-radius: 0.3rem;
            "label": "File",
  border: 1px solid var(--border-color-muted);
            "description": "Description of what this file parameter is for",
  border-bottom: 0;
            "type": "string",
  margin-bottom: -1em;
            "required": true
  display: flow-root;
        },
"><span style="
        "option": {
  font-size: 120%;
            "label": "Option",
  font-weight: 900;
            "description": "Description of what this option does",
  color: {{{iconColor|{{file/color|{{{lang|{{{language|{{{2}}}}}}}}}}}}}};
            "type": "string",
">{{unicon|{{{icon|{{file/icon|{{{lang|{{{language|{{{2}}}}}}}}}}}}}}}}</span>&nbsp;{{{name|{{{filename|{{{1}}}}}}}}}</div>{{code|lang={{{lang|{{{language|{{{2}}}}}}}}}|line={{{line|}}}|copy={{{copy|yes}}}|highlight={{{highlight|}}}|{{{contents|{{{3}}}}}}}}</div></includeonly><noinclude>{{Documentation}}</noinclude>
            "suggestedvalues": ["value1", "value2", "value3", "value4"],
            "required": false
        }
    }
}
</templatedata>
 
== About ==
Used to display contents of a file.
{{META Pipe Character}}
 
== Usage ==
 
<nowiki>{{file|filename|language|contents}}</nowiki>
 
See documentation about <code>&lt;syntaxhighlight></code> for supported languages.
 
  <nowiki>{{file|main.c|c|
#include <stdio.h>
 
main( )
{
        printf("hello, world\n");
}
}}</nowiki>
 
== Example ==
{{file|main.c|c|
#include <stdio.h>
 
main( )
{
        printf("hello, world\n");
}
}}
 
</noinclude><includeonly><div
  style="
    width: 1.2em;
    height: 0;
    position: relative;
    top: 0.8em;
    left: 0.8em;
  "
>{{{icon|[[Image:Breeze-text-x-plain.png|link=]]}}}</div>{{#tag:pre|{{{filename|{{{1|{{META Error}}}}}}}}
|style=margin-bottom: 0; border-bottom:none; padding-bottom:1.75em; padding-left:2.7em; margin-top: 0;
}}{{#tag:syntaxhighlight|{{{contents|{{{3|{{META Error}}}}}}}}
|lang={{{lang|{{{2| }}}}}}
|style=margin-top: -1em;}}</includeonly>