irb:/(?x) ^ ( > | irb.*?:\d+:\d+ | (?: ruby-?)? \d.*?:\d+\s )>\s /
nospace:/^.{0,30}?[$%>#]/
dos:/^[A-Z]:.{0,28}?>/
* //namedcontinue//
irb:@(?x) ^ ( \?> | irb.*?:\d+:\d+[]'"/`*>] | (?: ruby-?)? \d.*?:\d+[]'"/`?]> )\s @
R:/^\+ /
python:...
nospace:undef continue
* //namedcomment//
irb:/#(?!{)/
dos:/^\s*rem(\s+|$)/
As you can see, for python, you only have to define a //continue// replacement, as the standard prompt definition will also catch the python prompt. irb needs to replace all the three definitions. The continue prompt ''undef continue'' is not special at all; this definition replaces the standard definition and will (most probably) never happen in real life. So it actually disables the continue prompt.
The last set of configuration options, //odtbackground//, //odtborderwidth// and //odtbordercolor// are used when exporting to odt with the help of the [[odt]] plugin.
==== odt support ====
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|creating a custom style]], The background, and background border are controlled by the 3 configuration options //odtbackground//, //odtborderwidth// and //odtbordercolor//.
* //odtbackground// is the Background colour. By default, the same colour as the one used for //// or //// is used: ''#f7f9fa''.
* //odtborderwidth// is the border width. by default, the same as //// or ////: ''0.06pt''
* //odtbordercolor// is the border colour. by default, the same as //// or ////: ''#8cacbb''
==== 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 [[devel:css#user_styles|user styles]]. This example should work with most dokuwiki [[:template|templates]].
#dokuwiki__content pre.cli {
/* This changes the default style */
background-color: #000;
span.cli_prompt { color: red }
span.cli_command { color: white }
span.cli_comment { color: grey }
span.cli_output { color: yellow }
/* retro green and retro green with prompt in reverse video */
&.retro-green, div.retro-green {
background-color: #1e2e15;
span.cli_prompt { color: #0bc81b }
span.cli_command { color: #8fe35f }
span.cli_comment { color: #69a845 }
span.cli_output { color: #93eb60 }
&.reverse {
span.cli_prompt { color: #1e2e15; background-color: #93eb60; font-weight: bold }
}
}
/* retro ochre and retro ochre with prompt in reverse video */
&.retro-ochre, div.retro-ochre {
background-color: #2b2514;
span.cli_prompt { color: #ff8a11 }
span.cli_command { color: #ffbf0e }
span.cli_comment { color: #a87f0d }
span.cli_output { color: #de7407 }
&.reverse {
span.cli_prompt { color: #2b2514; background-color: #de7407; font-weight: bold }
}
}
/* Just for fun, but should be useless */
&.uppercase, div.uppercase {
text-transform: uppercase;
}
}
Here are some examples
me@mycomputer (0) $ ls # list files
README i prompt-plugin.txt
basic-usage.png lang style.css
conf plugin.info.txt syntax.php
dos-example.png prompt-examples.txt
{{ https://imagizer.imageshack.com/img921/2705/8iB6AN.png }}
me@mycomputer (0) $ ls -adtr * # list files with weid args
README i prompt-plugin.txt
basic-usage.png lang style.css
conf plugin.info.txt syntax.php
dos-example.png prompt-examples.txt
{{ https://imagizer.imageshack.com/img922/3950/HWLFjg.png }}
C:\>dir
Volume in drive C is mu/drives/c
Directory of C:\
TMP 12-28-17 6:29a
CONFIG SYS 346 06-22-15 1:17a
AUTOEXEC BAT 556 06-22-15 1:17a
2 file(s) 902 bytes
1 dir(s) 2,147,450,880 bytes free
C:\>echo pouet
pouet
C:\>rem This is a remark and does nothing
{{ https://imagizer.imageshack.com/img924/6294/Jqebtx.png }}
----
A few technical details.
'''' are rendered as html '''' tags with ''cli'' class. Classe from the ''type'' attribute is added as well as optional classes.
is rendered as
A full example:
me@mycomputer (0) $ dosemu # let's go back in the 80s
C:>rem This is a remark and does nothing
C:>echo pouet
pouet
C:>exit
me@mycomputer (0) $
Will produce this html code
me@mycomputer (0) $ dosemu # let's go back in the 80s
C:>rem This is a remark and does nothing
C:>echo pouet
pouet
C:>exit
me@mycomputer (0) $ exit
===== Development =====
=== Change Log ===
{{rss>https://github.com/schplurtz/dokuwiki-plugin-cli/commits/master.atom date}}
=== ToDo/Wish List ===
Please, create an issue on [[https://github.com/schplurtz/dokuwiki-plugin-cli/issues|GitHub]].
===== FAQ =====
===== Discussion =====
Please, discuss on the [[https://forum.dokuwiki.org/|forum]].
----
===== Acknowledgements =====
This plugin was originally written in 2007 by [[https://github.com/cpjobling|Chris P. Jobling]]. He was inspired by a similar feature found in [[http://moinmo.in/|MoinMoin Wiki]] and [[http://tiddlywiki.com/|TiddlyWiki]]. The styles were 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 were based on lessons Chris learned from the [[tutorial|Plugin Tutorial]] and Christopher Smith's implementation and documentation of the [[box|boxes plugin]].
Several improvements suggested by Stephane Chazelas and Andy Webber.
More than 12 years after its creation, this plugin was modernized by Schplurtz le Déboulonné who added a few features.