Difference between revisions of "Template:File/doc"

From stoney cloud
Jump to: navigation, search
m
m (Rework)
Line 2: Line 2:
 
Use this template to show a file box with some content.
 
Use this template to show a file box with some content.
  
== Usage ==
+
== Parameters ==
Add this code to the page text:
+
;1. unnamed: Add the filename.
<pre>
+
;2. unnamed (optional): Add some description (optional as can be blank).
{{File|filename|some description|
+
;3. unnamed: Add the code.
file content
+
}}
+
</pre>
+
{{File|filename|some description|
+
file content
+
}}
+
  
If you want to preserve the format of the file content, use <nowiki><pre> ... </pre></nowiki> tags for pre-formatted text:
+
== Usage ==
<pre>
+
See the template's [[Template:File/testcases|testcases]]:
{{File|filename|some description|&lt;pre&gt;
+
{{Template:File/testcases}}
file content
+
  this
+
    that
+
&lt;/pre&gt;}}
+
</pre>
+
{{File|filename|some description|<pre>
+
file content
+
  this
+
    that
+
</pre>}}
+
  
 
<includeonly>
 
<includeonly>

Revision as of 15:54, 23 August 2012

Note
This page is a template. It contains some standardized, often used text, which can be transcluded inside other pages.

As this template is widely used in our wiki, it may be protected in which case only staff members can change it. Use the discussion page to propose enhancements, fixes or voice your opinion.

Use this template to show a file box with some content.

Parameters

1. unnamed
Add the filename.
2. unnamed (optional)
Add some description (optional as can be blank).
3. unnamed
Add the code.

Usage

See the template's testcases:


Parameter: 1. unnamed, 2. unnamed (empty), 3. unnamed
Wiki code
{{File|filename||<pre>
file content
  this
    that
</pre>}}

Main version
Filefilename

file content
  this
    that

Sandbox version


Parameter: 1. unnamed, 2. unnamed , 3. unnamed
Wiki code
{{File|filename|some description|<pre>
file content
  this
    that
</pre>}}

Main version
Filefilenamesome description

file content
  this
    that

Sandbox version