File:  [NetBSD Developer Wiki] / wikisrc / templates / filecontent.mdwn
Revision 1.2: download - view: text, annotated - select for diffs
Fri Feb 4 00:46:01 2011 UTC (3 years, 2 months ago) by wiki
Branches: MAIN
CVS tags: HEAD
web commit by jym

<fieldset>
<legend><TMPL_VAR raw_name></legend>
<pre>
<TMPL_VAR raw_text>
</pre>
</fieldset>
<TMPL_UNLESS NAME="text">

## Description

Use this template to display the content of a file, while making a clear distinction with the [[programlisting_template|templates/programlisting]].

Remember that shell commands may be prefixed by:

* *name* - the name (or path) of the file
* *text* - text to display as file's content

## Examples

[[!template id=filecontent name="/etc/fstab" text="""
/dev/wd0a   /     ffs      rw,log   1 1
/dev/wd0b   none      swap     sw       0 0
kernfs      /kern     kernfs   rw
ptyfs       /dev/pts  ptyfs    rw
procfs      /proc     procfs   rw
/dev/cd0a   /cdrom    cd9660   ro,noauto
"""]]

is obtained with:

    \[[!template id=filecontent name="/etc/fstab" text="""
    /dev/wd0a   /     ffs      rw,log   1 1
    /dev/wd0b   none      swap     sw       0 0
    kernfs      /kern     kernfs   rw
    ptyfs       /dev/pts  ptyfs    rw
    procfs      /proc     procfs   rw
    /dev/cd0a   /cdrom    cd9660   ro,noauto
    """]]
</TMPL_UNLESS>

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb