Template:File/Doc: Difference between revisions

From Octave
Jump to navigation Jump to search
(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.


Example: <pre>{{File|/etc/conf.d/915resolution|<pre>
* the actual code still needs to be inside a {{Codeline|<nowiki><pre> ... </pre></nowiki>}} block.
# Copyright 1999-2006 Gentoo Foundation
* to markup ''only'' the name of a file (e.g., {{path|/etc/octave3.2.conf}}), use [[Template:Path]] instead.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-apps/915resolution/files/confd,v 1.3 2007/04/17 16:52:24 genstef Exp $


# Config file for /etc/init.d/915resolution
Example:
# based on the config file included with sys-apps/855resolution
<pre>{{File|~/.octaverc|<pre>
## make prompt look like python
PS1(">>> ")
PS2("... ")


# this example will replace mode "4d" with 1280x768x24
## alias help to man
# to replace more than one mode do something like this
function man (name)
#replace="'4d 1280 768 24' '5c 1400 1050 16'"
  help (char (name))
replace="'5c 800 480 32'"
endfunction


# if you want to log the output add the file here.
## load all packages
# this will be overwritten at every boot
pkg load all;
log="/var/log/915resolution"
&lt;/pre>}}</pre>
&lt;/pre>}}</pre>


Will produce:
Will produce:
{{File|/etc/conf.d/915resolution|<pre>
{{File|~/.octaverc|<pre>
# Copyright 1999-2006 Gentoo Foundation
## make prompt look like python
# Distributed under the terms of the GNU General Public License v2
PS1(">>> ")
# $Header: /var/cvsroot/gentoo-x86/sys-apps/915resolution/files/confd,v 1.3 2007/04/17 16:52:24 genstef Exp $
PS2("... ")


# Config file for /etc/init.d/915resolution
## alias help to man
# based on the config file included with sys-apps/855resolution
function man (name)
  help (char (name))
endfunction


# this example will replace mode "4d" with 1280x768x24
## load all packages
# to replace more than one mode do something like this
pkg load all;
#replace="'4d 1280 768 24' '5c 1400 1050 16'"
replace="'5c 800 480 32'"
 
# if you want to log the output add the file here.
# this will be overwritten at every boot
log="/var/log/915resolution"
</pre>}}
</pre>}}


To markup ''only'' the name of a file (e.g., {{path|/etc/conf.d/915resolution}}), use [[Template:Path]] instead.
[[Category:Template with documentation]]
 
<noinclude>[[Category:Template Documentation]]</noinclude>

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;