Movatterモバイル変換


[0]ホーム

URL:


Trac Hacks
wiki:ShellExampleMacro

Context Navigation


Contents

  1. Description
    1. Technical Details
  2. Bugs/Feature Requests
  3. Download
  4. Source
  5. Installation
  6. Recent Changes
  7. Author/Contributors

Display command line shell examples in Trac wiki pages

Description

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:

Example of processed text

Additional examples are availablehere.

Technical Details

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:

  • se-input
  • se-input-userreplacement
  • se-input-string
  • se-input-continuation
  • se-input-option
  • se-input-delayed
  • se-prompt
  • se-prompt-start
  • se-prompt-user
  • se-prompt-userhostseparator
  • se-prompt-host
  • se-prompt-path
  • se-prompt-end
  • se-root
  • se-unprivileged
  • se-note
  • se-output
  • se-output-snipped
{{{#!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>

Bugs/Feature Requests

Existing bugs and feature requests forShellExampleMacro arehere.

If you have any issues, create anew ticket.

defect

2 / 2

enhancement

0 / 2

Download

Download the current source (0.12.2) fromhere.

There is also a version onPyPi.

Source

You can check outShellExampleMacro fromhere using Subversion, orbrowse the source with Trac.

Installation

You can install this software as a normal Trac plugin.

  1. Uninstall ShellExample wiki processor if you have installed before.
  2. Change to the directory containingsetup.py.
  3. If you want to install this plugin globally, that will install this plugin to the Python path:
    python setup.py install
  4. If you want to install this plugin to Trac instance only:
    python setup.py bdist_eggcopy the generated egg file to the trac instance's plugin directorycp dist/*.egg/srv/trac/env/plugins
  5. Configure yourtrac.ini file:
    [components]shellexample.*=enabled

Recent Changes

11485 byrjollos on 2012-04-14 00:37:00
Fixes#9900:get_templates_dirs needs to return an empty list, but it was returningNone. This should fix a reported instance of theAnnouncerPlugin throwing an error.
11484 byrjollos on 2012-04-14 00:26:50
Removed empty directory.
10269 bynmadura on 2011-06-08 19:48:59
tagged 0.12.2 release
(more)

Author/Contributors

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:

Last modified8 years agoLast modified on Oct 1, 2016, 9:45:39 AM

Attachments(1)

Download all attachments as:.zip

Download in other formats:


Trac Powered

Powered byTrac 1.2.6
ByEdgewall Software.


[8]ページ先頭

©2009-2025 Movatter.jp