Template:File/Doc: Difference between revisions
Jump to navigation
Jump to search
Carandraug (talk | contribs) (documentation for File template) |
Carandraug (talk | contribs) (octavified example) |
||
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. Note that the actual code still needs to be inside a <nowiki><pre>...</pre></nowiki> block. | ||
Example: <pre>{{File|/ | Example: <pre>{{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> | </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>}} | ||
To markup ''only'' the name of a file (e.g., {{path|/etc/conf.d/915resolution}}), use [[Template:Path]] instead. | To markup ''only'' the name of a file (e.g., {{path|/etc/conf.d/915resolution}}), use [[Template:Path]] instead. | ||
<noinclude>[[Category:Template Documentation]]</noinclude> | <noinclude>[[Category:Template Documentation]]</noinclude> |
Revision as of 01:07, 7 December 2011
This template is used to include the contents of files. The first argument is the filename/filepath. Note that the actual code still needs to be inside a <pre>...</pre> block.
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;
To markup only the name of a file (e.g., /etc/conf.d/915resolution), use Template:Path instead.