Template:File/Doc: Difference between revisions
Jump to navigation
Jump to search
Carandraug (talk | contribs) (documentation for File template) |
No edit summary |
||
(4 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
This template is used to include the contents of files. | This template is used to include the contents of files. The first argument is the filename/filepath but can be left blank. | ||
* the actual code still needs to be inside a {{Codeline|<nowiki><pre> ... </pre></nowiki>}} block. | |||
* to markup ''only'' the name of a file (e.g., {{path|/etc/octave3.2.conf}}), use [[Template:Path]] instead. | |||
Example: | |||
# | <pre>{{File|~/.octaverc|<pre> | ||
## make prompt look like python | |||
PS1(">>> ") | |||
PS2("... ") | |||
# | ## alias help to man | ||
# to | function man (name) | ||
help (char (name)) | |||
endfunction | |||
# | ## load all packages | ||
# | pkg load all; | ||
</pre>}}</pre> | </pre>}}</pre> | ||
Will produce: | Will produce: | ||
{{File|/ | {{File|~/.octaverc|<pre> | ||
# | ## make prompt look like python | ||
PS1(">>> ") | |||
PS2("... ") | |||
# | ## alias help to man | ||
function man (name) | |||
help (char (name)) | |||
endfunction | |||
# | ## load all packages | ||
pkg load all; | |||
# | |||
</pre>}} | </pre>}} | ||
[[Category:Template with documentation]] | |||
Latest revision as of 10:52, 30 November 2013
This template is used to include the contents of files. The first argument is the filename/filepath but can be left blank.
- the actual code still needs to be inside a
<pre> ... </pre>
block. - to markup only the name of a file (e.g., /etc/octave3.2.conf), use Template:Path instead.
Example:
{{File|~/.octaverc|<pre> ## make prompt look like python PS1(">>> ") PS2("... ") ## alias help to man function man (name) help (char (name)) endfunction ## load all packages pkg load all; </pre>}}
Will produce:
File: ~/.octaverc
## make prompt look like python PS1(">>> ") PS2("... ") ## alias help to man function man (name) help (char (name)) endfunction ## load all packages pkg load all;