plugin:cli
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
plugin:cli [2023-04-10 17:27] – compatible with jack jackrum (tested) schplurtz | plugin:cli [2023-04-15 21:12] (current) – Aleksandr | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== CLI : a Command Line Interface formatter Plugin | + | ====== CLI: a Command Line Interface formatter Plugin |
---- plugin ---- | ---- plugin ---- | ||
Line 18: | Line 18: | ||
screenshot_img : | screenshot_img : | ||
---- | ---- | ||
- | |||
===== Description ===== | ===== Description ===== | ||
- | This plugin brings a Command Line Interface formatter to Dokuwiki | + | This plugin brings a Command Line Interface formatter to DokuWiki |
allowing you to format the output of a transcript say for a user | 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 | manual or on-line tutorial. It is designed to work with the output | ||
Line 42: | Line 41: | ||
===== Installation ===== | ===== Installation ===== | ||
- | Install the plugin using the [[plugin: | + | Install the plugin using the [[extension|Extension |
===== Examples/ | ===== Examples/ | ||
Line 55: | Line 54: | ||
</ | </ | ||
- | {{https:// | + | {{ https:// |
Next example shows that ''< | Next example shows that ''< | ||
Line 86: | Line 85: | ||
</ | </ | ||
- | {{https:// | + | {{ https:// |
Custom prompts, when there are no satisfying defaults | Custom prompts, when there are no satisfying defaults | ||
Line 102: | Line 101: | ||
</ | </ | ||
- | {{https:// | + | {{ https:// |
===== Syntax ===== | ===== Syntax ===== | ||
Line 113: | Line 112: | ||
* //prompt// --- [optional] the prompt used by the CLI. See configuration below for the description of the syntax. If omitted, the default value is used. | * //prompt// --- [optional] the prompt used by the CLI. See configuration below for the description of the syntax. If omitted, the default value is used. | ||
- | * // | + | * // |
* //comment// --- [optional] the comment used by the CLI. See configuration below for the description of the syntax. If omitted, the default value is used. | * //comment// --- [optional] the comment used by the CLI. See configuration below for the description of the syntax. If omitted, the default value is used. | ||
- | * // | + | * // |
- | * //class// --- [optional] Class to add to the html block. This allows to create all sorts of custom [[# | + | * //class// --- [optional] Class to add to the html block. This allows to create all sorts of custom [[#style]]. |
Each of the values may be enclosed in single ('' | Each of the values may be enclosed in single ('' | ||
+ | |||
Within single quotes, «\\» stands for «\» and «\' | Within single quotes, «\\» stands for «\» and «\' | ||
+ | |||
Within double quotes, «\\» stands for «\» and «%%\" | Within double quotes, «\\» stands for «\» and «%%\" | ||
- | In unquoted strings, the following characters must be \-escaped to be part of the string : «"», «%%' | + | |
+ | In unquoted strings, the following characters must be \-escaped to be part of the string: «'' | ||
There may be spaces around the equal sign. | There may be spaces around the equal sign. | ||
- | The following examples are all equivalent : | + | The following examples are all equivalent: |
<cli comment=\" | <cli comment=\" | ||
<cli comment = " | <cli comment = " | ||
<cli ' | <cli ' | ||
- | The opening '' | + | The opening '' |
- | Values are always set in this order : default, shortcut, individual settings. | + | Values are always set in this order: default, shortcut, individual settings. |
''< | ''< | ||
Line 141: | Line 143: | ||
The plugin has 9 configuration settings. The first 3 are the default prompts and comment marker to use. | The plugin has 9 configuration settings. The first 3 are the default prompts and comment marker to use. | ||
- | * //prompt// is a either a regexp((enclosed in <<''/''>>, | + | * //prompt// is a either a regexp((enclosed in <<''/''>>, |
* // | * // | ||
* //comment// is a description of the comment marker. Also a string or regexp. It is matched only to the part of each transcript lines **after** the prompt. For this regexp, the start of line is the first non-prompt char of a command line. | * //comment// is a description of the comment marker. Also a string or regexp. It is matched only to the part of each transcript lines **after** the prompt. For this regexp, the start of line is the first non-prompt char of a command line. | ||
Line 147: | Line 149: | ||
If any of these is empty, then the cli plugin uses a harcoded internal value that corresponds to the defaults shown below. | If any of these is empty, then the cli plugin uses a harcoded internal value that corresponds to the defaults shown below. | ||
- | Default values : | + | Default values: |
* //prompt// ''/ | * //prompt// ''/ | ||
* // | * // | ||
- | * // | + | * //comment// ''/ |
- | The next three settings (namedprompt, | + | The next three settings (namedprompt, |
name: | name: | ||
- | It is not necessary that values are given for the three of them. The defaults below define shortcuts for interactive | + | It is not necessary that values are given for the three of them. The defaults below define shortcuts for interactive |
* // | * // | ||
Line 176: | Line 178: | ||
As you can see, for python, you only have to define a // | As you can see, for python, you only have to define a // | ||
- | The last set of configuration options, // | + | The last set of configuration options, // |
==== odt support ==== | ==== odt support ==== | ||
- | When exporting a page to odt with the [[dw> | + | When exporting a page to odt with the [[odt]] plugin, font colours are taken from the CSS **default** style. Computer output is blue, prompt is green, user input red and comments orange. You may change the default colours for both html and odt by [[# |
- | * // | + | * // |
- | * // | + | * // |
- | * // | + | * // |
==== style ==== | ==== style ==== | ||
- | You may customize the colours of the text and also the border, background, padding, margin, font etc... well, pretty much anything customizable with CSS. Where to create your CSS files is documented in [[doku>devel: | + | You may customize the colours of the text and also the border, background, padding, margin, font etc... well, pretty much anything customizable with CSS. Where to create your CSS files is documented in [[devel: |
<code css userstyle.css> | <code css userstyle.css> | ||
Line 236: | Line 238: | ||
</ | </ | ||
- | {{https:// | + | {{ https:// |
<cli green uppercase> | <cli green uppercase> | ||
Line 246: | Line 248: | ||
</ | </ | ||
- | {{https:// | + | {{ https:// |
<cli type=dos retro-ochre reverse> | <cli type=dos retro-ochre reverse> | ||
Line 262: | Line 264: | ||
</ | </ | ||
- | {{https:// | + | {{ https:// |
- | ----------------- | + | ---- |
A few technical details. | A few technical details. | ||
+ | |||
''< | ''< | ||
Line 281: | Line 284: | ||
</ | </ | ||
- | A full example : | + | A full example: |
<code xml> | <code xml> | ||
Line 322: | Line 325: | ||
=== ToDo/Wish List === | === ToDo/Wish List === | ||
- | Please, create an issue on [[https:// | + | Please, create an issue on [[https:// |
===== FAQ ===== | ===== FAQ ===== | ||
Line 329: | Line 332: | ||
===== Discussion ===== | ===== Discussion ===== | ||
- | Please, discuss on the [[https:// | + | Please, discuss on the [[https:// |
- | + | ---- | |
- | ----------------------- | + | |
===== Acknowledgements ===== | ===== Acknowledgements ===== | ||
- | This plugin was originally written in 2007 by | + | This plugin was originally written in 2007 by [[https:// |
- | [[https:// | + | |
- | by a similar feature found in [[http://moinmoin.wikiwikiweb.de/|MoinMoin | + | |
- | Wiki]] and [[http://www.tiddlywiki.com/ | + | |
- | were based on those developed for the | + | |
- | [[http:// | + | |
- | Beginners]] by Michael Stonebank. The plugin and its documentation | + | |
- | were based on lessons Chris learned from the | + | |
- | [[http:// | + | |
- | Christopher Smith' | + | |
- | [[http:// | + | |
Several improvements suggested by Stephane Chazelas and Andy Webber. | Several improvements suggested by Stephane Chazelas and Andy Webber. | ||
- | More than 12 years after its creation, this plugin was | + | More than 12 years after its creation, this plugin was modernized by Schplurtz le Déboulonné who added a few features. |
- | modernized by Schplurtz le Déboulonné who added a few features. | + | |
plugin/cli.txt · Last modified: 2023-04-15 21:12 by Aleksandr