File:  [NetBSD Developer Wiki] / wikisrc / templates / programlisting.mdwn
Revision 1.1: download - view: text, annotated - select for diffs
Wed May 12 14:44:35 2010 UTC (10 years, 9 months ago) by jym
Branches: MAIN
CVS tags: HEAD
Add programlisting template, to mimic the functionality found in htdocs.

    1: <div class="programlisting">
    2: <div>
    3: <TMPL_VAR text>
    4: </div>
    5: </div>
    6: <TMPL_UNLESS NAME="text">
    7: 
    8: ## Description
    9: 
   10: Use this template to display a program listing, or a succession of commands (together with their output).
   11: 
   12: Remember that shell commands may be prefixed by:
   13: * *$* when the command should be run as a normal user
   14: * *#* when the command should be run as root
   15: 
   16: * *text* - text to display as program listing.
   17: 
   18: ## Examples
   19: 
   20: [[!template id=programlisting text="""
   21: $ uname
   22: NetBSD
   23: $ cd /bin
   24: $ ls
   25: [          cpio       domainname kill       mt         rcmd       sleep
   26: cat        csh        echo       ksh        mv         rcp        stty
   27: chio       date       ed         ln         pax        rm         sync
   28: chmod      dd         expr       ls         ps         rmdir      tar
   29: cp         df         hostname   mkdir      pwd        sh         test
   30: """]]
   31: 
   32: is obtained with:
   33: 
   34:     \[[!template id=programlisting text="""
   35:     $ uname
   36:     NetBSD
   37:     $ cd /bin
   38:     $ ls
   39:     [          cpio       domainname kill       mt         rcmd       sleep
   40:     cat        csh        echo       ksh        mv         rcp        stty
   41:     chio       date       ed         ln         pax        rm         sync
   42:     chmod      dd         expr       ls         ps         rmdir      tar
   43:     cp         df         hostname   mkdir      pwd        sh         test
   44:     """]]
   45: 
   46: </TMPL_UNLESS>
   47: 
   48: 
   49: 
   50: <div class="programlisting">
   51: <TMPL_VAR text>
   52: </div>
   53: <TMPL_UNLESS NAME="text">
   54: 
   55: ## Description
   56: 
   57: Use this template to display a program listing, or a succession of commands (together with their output).
   58: 
   59: Remember that shell commands may be prefixed by:
   60: * *$* when the command should be run as a normal user
   61: * *#* when the command should be run as root
   62: 
   63: * *text* - text to display as program listing.
   64: 
   65: ## Examples
   66: 
   67: [[!template id=programlisting text="""
   68: $ uname
   69: NetBSD
   70: $ cd /bin
   71: $ ls
   72: [          cpio       domainname kill       mt         rcmd       sleep
   73: cat        csh        echo       ksh        mv         rcp        stty
   74: chio       date       ed         ln         pax        rm         sync
   75: chmod      dd         expr       ls         ps         rmdir      tar
   76: cp         df         hostname   mkdir      pwd        sh         test
   77: """]]
   78: 
   79: is obtained with:
   80: 
   81:     \[[!template id=programlisting text="""
   82:     $ uname
   83:     NetBSD
   84:     $ cd /bin
   85:     $ ls
   86:     [          cpio       domainname kill       mt         rcmd       sleep
   87:     cat        csh        echo       ksh        mv         rcp        stty
   88:     chio       date       ed         ln         pax        rm         sync
   89:     chmod      dd         expr       ls         ps         rmdir      tar
   90:     cp         df         hostname   mkdir      pwd        sh         test
   91:     """]]
   92: 
   93: </TMPL_UNLESS>

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