The Processor Bazaar
Looking for fresh wiki processor goodness for your Trac installation? Have you written a clever wiki-processor you're dying to share with the world? This is the place.
The wiki-processor bazaar is for sharing information about user-developed processors and links to source code and requests.
Note: Please state your name, email, and version of Trac your wiki-processor is developed for.
How to use these wiki-processors:
- Just put the files into the wikimacros directory of your Python installation, e.g. /usr/lib/python2.3/site-packages/trac/wikimacros (for 0.10, this might be /usr/lib/python2.?/site-packages/trac/mimeview). The macros will then be available for all your Trac environments.
- Alternatively, put the files into the wiki-macros directory of your Trac environment, e.g. /data/trac/wiki-macros. The macros will be available only for this environment.
LegendBox
A wiki-processor for encapsulating wiki text inside a box. The box will have a legend and a modifiable color. To use this, simply place it into wikimacro directory and use it.
Example:
{{{
#!LegendBox
#!color: blue
#!legend: My Title
Here comes the actual text that will be inside the box.
You can even use wiki-formatting in here.
}}}
You can modify the default COLOR and LEGEND and the STYLE in the plugin file.
Download: LegendBox.py
By: Jan Finell (finell at cenix-bioscience.com)
Required ver: > 0.8pre (though changing the import of the wiki_to_html function will make it work on older versions)
For version 0.9pre2, I could not use the version above, some things have changed. The version below works for me.
Download: LegendBox-0.9pre2.py
By: Pedro Melo (melo at simplicidade.org)
Required ver: > 0.9pre2
For Trac version 0.10:
Download: LegendBox-0.10.py
By: Lars Stavholm (stava at linadd.org)
Required ver: >= 0.10
Striped
A Trac wiki-processor to display text as a striped listing.
The output is enclosed in a <pre> block of class "striped", and each line in a <div> block of alternating "even-stripe" and "odd-stripe" classes. You must set this classes up in your templates/site_css.cs file, or alternatively use the processor arguments "box-style", "even-style" and "odd-style".
The "number" argument allows automatic numbering of lines; it accepts three args: a Python-style format (quotes and all), the initial number for the first line, and the step between numbers. If no format is passed, there is no automatic numbering; otherwise, the start and step arguments default to 1.
Example:
{{{
#!Striped
#!number: " %3d ", 100, 10
#!box-style: border: thick solid #C0C0C0; margin: 20px; width: 70%;
#!even-style: background-color: #DAC0DA;
...text here...
}}}
(A lot of ideas and syntax for arguments shamelessly stolen from previous entry by Jan Finell. Thanks!)
Download: Striped.py
By: Juanma Barranquero (lekktu at gmail.com)
Tested on: 0.8 (should work on previous versions, though)
DocBook
Requires:
- libxml2-python (developed with version 2.6.11)
- libxslt-python (developed with version 1.1.8)
Specify "stylesheet" under the "docbook" section in your trac.ini, for example:
[docbook] stylesheet = /usr/share/xml/docbook/stylesheet/nwalsh/xhtml/docbook.xsl
Include DocBook? mark-up in a wiki blockquote, with the docbook processor selected:
{{{
#!docbook
...DocBook mark-up here...
}}}
Download: docbook.py
By: Simon Ward <simon@…>
Version: 0.8.x
If you have problems with an error message like get_config is not supported try this
stylesheet = env.config.get('docbook', 'stylesheet')
SortedTable
A WikiProcessor which sorts tables with JavaScript.
Requires sorttable.js from http://www.kryogenix.org/code/browser/sorttable/ .
Usage:
- Fetch sorttable.js (see above)
- Put the script somewhere on your HTTP server and set the variable sorttable_js_url in TracIni OR put the JavaScript file in the same directory as the Python file.
- Use WikiProcessor syntax like
{{{ #!sortedtable || Strings || Numbers || || abc || 2 || || def || 10 || || abd || 9 || }}}Use the usual table syntax for wiki pages. - If the browser has JavaScript enabled, you will be able to sort the resulting table by clicking on the headings in the first row.
Download: http://www.sschwarzer.net/download/sortedtable.py
By: Stefan Schwarzer (sschwarzer at sschwarzer dot net)
Version: >= 0.8 (tested with 0.8)
IrcLog
A WikiProcessor that colourises IRC logs.
To use, import the stylesheets in your $TRAC_ENV/templates/site_css.cs and mark-up your IRC text as follows:
{{{
#!irclog
...
}}}
It formats logs in the default format used by Xchat, as well as some others.
The irclog processor is distributable under the terms of the GNU GPL (see: http://www.gnu.org/copyleft/gpl.html).
Based on irclog2html.py by Marius Gedminas.
Download: http://projects.bleah.co.uk/misc/browser/tracirclog/trunk
By: Simon Ward <simon@…>
Version: 0.8.x
BlockQuote
A simple processor that wraps the processed text in blockquote tags. While Trac provides markup for blockquotes, a processor appears to be easier to use for larger quotes.
Usage:
{{{
#!blockquote
This is the text that goes between the blockquote tags. Even WikiFormatting works.
You might want to add custom CSS for blockquotes...
}}}
A working example can be seen here.
Download: blockquote-0.1.1.py
By: Michael Renzmann <mrenzmann@…>
Version: 0.9b2 (might work with older versions as well)
Last change: v0.1.1 now correctly handles WikiFormatting in quoted texts
graphviz
A processor that uses Graphviz' dot to make graphs.
Usage:
{{{
#!graphviz
digraph G {
A [color = green];
A -> B -> C -> A
C -> B
}
}}}
Version: >= 0.8
Download: graphviz.py
By: Vegard Eriksen zyp at jvnv dot net
Note: A much more powerful Graphviz processor is available here.
latex-math
A processor that uses LaTeX to make math. Loosely based on graphviz.py and mt-math.
Usage:
{{{
#!latex-math
E=mc^2
}}}
Version: >= svn162
Download: https://svn.truelite.it/packages/browser/trunk/truelite-trac-utils/
and
https://svn.truelite.it/packages/file/trunk/truelite-trac-utils/wiki-macros/latex-math.py
By: Mirko Maischberger mirko dot maischberger at gmail dot com
Note: This spawn a latex process, you'll need tetex, tetex-extra and dvipng. This is also non suitable for public wikis becuase spawning an external latex process is not secure (unless properly configured).
ShellExample
A processor that produce gentoo document code listing, .
Usage:
{{{
#!ShellExample
~ $ make
(becomes root and install)
~ $ su
~ # make install
}}}
Version: >= unknown
Download: http://trac.lighttpd.net/xcache/wiki/ShellExample
By: mOo
Version: 4
pascal
A simple processor that uses predefined processor to make highlighted output of the pascal source code.
You have to use additional code highlighting processor such as enscript
Usage:
{{{
#!pascal
procedure Example(const A, B : byte);
begin
if (A=B) then for i:=0 to 25 do begin
WriteLn('Example');
end;
end;
}}}
Will produce:
procedure Example(const A, B : byte); begin if (A=B) then for i:=0 to 25 do begin WriteLn('Example'); end; end;
Download: pascal-0.0.1.py
By: SHadoW
Version: 0.0.1 Tested on trac 0.10 but should work on older versions
Requests
Requests, comments, etc go here.
- Request: A WikiProcessor for SVG http://www.svg-whiz.com/wiki/index.php?title=SVG_FAQ
- Request: A WikiProcessor for unified diffs (well, it's already there since 0.9, no? use #!diff in your block)
Request: A WikiProcessor for javascript syntax highlighting- Request: A WikiProcessor for mediawiki format (see http://trac-hacks.org/wiki/MediaWikiPluginMacro)
- Request: A WikiProcessor for twiki format - so we can move existing docs to Trac
- Request: A WikiProcessor for VERILOG HDL syntax highlighting
- Request: A WikiProcessor for markdown
- Request: A WikiProcessor for Perl's POD
See also: WikiProcessors, MacroBazaar
Attachments
- LegendBox.py (1.2 kB) - added by Jan Finell 4 years ago.
- Striped.py (2.5 kB) - added by Juanma Barranquero 4 years ago.
-
docbook.py
(0.6 kB) - added by simon@…
3 years ago.
DocBook? processor
-
LegendBox-0.9pre2.py
(1.2 kB) - added by Pedro Melo <melo-trac-tickets@…>
3 years ago.
Version that works with 0.9pre2
-
blockquote.py
(150 bytes) - added by mrenzmann@…
3 years ago.
blockquote processor
-
blockquote-0.1.1.py
(426 bytes) - added by mrenzmann@…
3 years ago.
blockquote processor v0.1.1 - handles WikiFormatting in quoted text correctly
-
graphviz.py
(0.5 kB) - added by Vegard Eriksen
2 years ago.
Graphviz-processor.
-
ShellExample.py
(1.5 kB) - added by mOo
2 years ago.
Shell Example Code Listing Processor
-
ShellExample.2.py
(1.5 kB) - added by mOo
2 years ago.
gentoo doc alike Shell Example Code Listing Processor
-
ShellExample.3.py
(1.9 kB) - added by mOo
2 years ago.
gentoo doc alike Shell Example Code Listing Processor v3
- pascal-0.0.1.py (391 bytes) - added by shadow 23 months ago.
-
LegendBox-0.10.py
(1.2 kB) - added by Lars Stavholm <stava@…>
21 months ago.
LegendBox macro updated for Trac 0.10
-
js-0.1.py
(511 bytes) - added by Jason Wadsworth <jdwadsworth@…>
18 months ago.
JavaScript Syntax Formatting Processor
-
svgdw.py
(4.5 kB) - added by chunghualee@…
10 months ago.
SVG macro for intranet use with FireFox? only
-
svgdw.2.py
(4.5 kB) - added by chunghualee@…
10 months ago.
SVG macro for intranet use with FireFox? only
- svgdw.3.py (4.5 kB) - added by anonymous 10 months ago.


