====== Color Plugin ====== ===== Informazioni generali ===== Questo plugin consente di formattare il testo specificato come se fosse la console di linux. **Sito:** [[http://www.dokuwiki.org/plugin:cli | http://www.dokuwiki.org/plugin:cli]] This plugins brings a Command Line Interface formatter to DokuWiki allowing you to format the output of a transcript say for a user manual or on-line tutorial. It is designed to work with the output of a standard Unix Bash Shell, but should be suitable to document other kinds of CLI interaction, e.g. Windows Command Window, Python and Ruby, Matlab, etc. The assumptions made are - all user commands start with a prompt - the CLI prompt will end in a recognizable character (typically '$' or '>') - user commands will follow the CLI prompt on the same line - lines that do not start with a prompt are outputs from the CLI((this turns out to be a problem for the Ruby interactive shell //irb// which seems to prefix every line with a prompt!)) A key design feature is that it should be possible to display a CLI transcript (e.g. output from a history file or copy of text from a console window) for display with the mimumum of additional markup. It is possible to adjust the style of the display using a style sheet. For details refer to [[#style.css]]. =====Acknowledgements===== A similar feature is to be found in [[http://moinmoin.wikiwikiweb.de/|MoinMoin Wiki]] and [[http://www.tiddlywiki.com/|TiddlyWiki]]. The styles are based on those developed for the [[http://www.ee.surrey.ac.uk/Teaching/Unix/|UNIX Tutorial for Beginners]] by Michael Stonebank. The plugin and its documentation are based on lessons learned from the [[http://www.dokuwiki.org/plugin:tutorial|Plugin Tutorial]] and Christopher Smith's implementation and documentation of the [[http://www.dokuwiki.org/plugin:boxes|boxes plugin]]. Several improvements suggested by Stephane Chazelas and Andy Webber. ===== Syntax ===== A simple Bash Shell interaction: user@host:~/somedir $ ls # List current directory conf lang README screen.gif ui info.txt manager.dat renderer.php syntax.php user@host:~/somedir $ Should be rendered:
  user@host:~/somedir $ ls # List current directory
  conf      lang         README        screen.gif  ui
  info.txt  manager.dat  renderer.php  syntax.php
  user@host:~/somedir $
  
The full syntax: transcript * //prompt// --- [optional] the prompt used by the CLI. ((In practice only the final character is needed as everything on the line up to the final character will be taken to be part of the prompt and everything after will be regarded as a command.)) If no prompt is given, '$ ' (note the space) is assumed (('$ ' is the standard Bash shell prompt)). * //comment// --- [optional] the comment string used by the CLI. If omitted, '#' is assumed (('#' is the standard Bash shell comment character)). * //continue// -- [optional] the prompt used for continuation markers: regex '/^> /' is the default. * The defaults above match Bourne shell ${PS1} and ${PS2} prompts and comments The opening ''****'' must all appear on one line. The transcript contents can appear over as many lines as are needed. ===== Esempi ===== ==== Code ==== user@host:~/somedir $ ls # List current directory conf lang README screen.gif ui info.txt manager.dat renderer.php syntax.php user@host:~/somedir $ \\ $ rpm -ivh darcs-1.0.9-3.fc6.i386.rpm Preparing... ########################################### [100%] 1:darcs ########################################### [100%] ==== Result ==== user@host:~/somedir $ ls # List current directory conf lang README screen.gif ui info.txt manager.dat renderer.php syntax.php user@host:~/somedir $ \\ $ rpm -ivh darcs-1.0.9-3.fc6.i386.rpm Preparing... ########################################### [100%] 1:darcs ########################################### [100%] \\