This is a wiki processor to display command line shell examples in Trac wiki pages.
This plugin has only been tested on Trac 0.12, and may work for later versions.
A typical example might look like this:
{{{#!ShellExample(full example showing how to use openssl to connect to a pops mail server)$ openssl s_client -connect mail.foo.com:995CONNECTED(00000003)depth=0 /C=US/ST=Nowhere/O=Foo/OU=bar/CN=mail.foo.com$$------+OK Dovecot ready. <1c32.1a611.4c4859c2.BEuUvAEtnt0du+msvFig0w==@mail.foo.com>$$ user {username}+OK$$ pass {password}+OK Logged in.$$ stat+OK 509 15659197$$ quit+OK Logging out.closed}}}
Produces output like this:
Additional examples are availablehere.
This is aWikiProcessor so it is used with the standard#!
notation. This processor injects css code into Trac, so you should get formatted output by default. Any tagged code is inside a span element, and the following classes are used:
{{{#!ShellExample{user@foo ~/path/to}$ foo --user {username}}}}
results in something like the following (expanded for easier reading):
<divclass="code"><pre><spanclass="se-prompt"><spanclass="se-prompt-start">{</span><spanclass="se-prompt-user">user</span><spanclass="se-prompt-userhostseparator">@</span><spanclass="se-prompt-host">foo</span><spanclass="se-prompt-path">~/path/to</span><spanclass="se-prompt-end">}</span></span><spanclass="se-unprivileged">$</span><spanclass="se-input">foo<spanclass="se-input-option">--user</span><spanclass="se-input-userreplacement">{username}</span></span></pre></div>
Existing bugs and feature requests forShellExampleMacro arehere.
If you have any issues, create anew ticket.
defect | 2 / 2 | ||
---|---|---|---|
enhancement | 0 / 2 |
Download the current source (0.12.2) fromhere.
There is also a version onPyPi.
You can check outShellExampleMacro fromhere using Subversion, orbrowse the source with Trac.
You can install this software as a normal Trac plugin.
setup.py
.python setup.py install
python setup.py bdist_eggcopy the generated egg file to the trac instance's plugin directorycp dist/*.egg/srv/trac/env/plugins
trac.ini
file:[components]shellexample.*=enabled
get_templates_dirs
needs to return an empty list, but it was returningNone
. This should fix a reported instance of theAnnouncerPlugin throwing an error.This plugin was originally developed by mOo.Nathaniel Madura significantly updated this plugin, and took over maintenance of it.
Author:nmadura
Maintainer:Nathaniel Madura
Contributors:
Example of processed text
Download all attachments as:.zip