Template:File: Difference between revisions

Sdht0 (talk | contribs)
Reduce padding
DoggoBit (talk | contribs)
m make params consistent
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<noinclude>{{Template}}{{DISPLAYTITLE:Template:file}}
<includeonly><div><div style="
The contents of a file.
  background-color: var(--background-color-neutral-subtle);
{{META Pipe Character}}
  line-height: 1.3;
 
   font-family: monospace;
== Usage ==
  padding: 0.5em 1em;
 
  border-top-left-radius: 0.3rem;
<nowiki>{{file|filename|language|contents}}</nowiki>
  border-top-right-radius: 0.3rem;
 
  border: 1px solid var(--border-color-muted);
See documentation about <code>&lt;syntaxhighlight></code> for supported languages.
  border-bottom: 0;
 
  margin-bottom: -1em;
<nowiki>{{file|default.nix|nix|&lt;nowiki>
  display: flow-root;
{...}
"><span style="
{
  font-size: 120%;
   # Comment
  font-weight: 900;
}
  color: {{{iconColor|{{file/color|{{{lang|{{{language|{{{2}}}}}}}}}}}}}};
&lt;/nowiki>}}</nowiki>
">{{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>
 
== Example ==
 
<nowiki>{{file|main.c|c|
#include <stdio.h>
 
main( )
{
        printf("hello, world\n");
}
}}</nowiki>
 
<hr />
{{file|main.c|c|
#include <stdio.h>
 
main( )
{
        printf("hello, world\n");
}
}}
<hr />
 
</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:1em; padding-left:2.7em; margin-top: 0;
}}{{#tag:syntaxhighlight|{{{contents|{{{3|{{META Error}}}}}}}}
|lang={{{lang|{{{2| }}}}}}
|style=margin-top: -1em;}}
</includeonly>