Include source Wiki Macro for trac

This tiny plugin provides a migration with subversionized wiki source to wiki for trac, one of the most famous and powerful web based project manage and bug tracking system.
trac includes, you know, the front end of subversion and trac wiki page, but they are separated in it. This plugin defines a new wiki macro “IncludeSource”, then you can use a source file under subversion as wiki source for trac wiki.
The wiki page includes this plugin code, the wiki source is dynamically loaded from svn. Once you changed the wikisource.txt and commit it, the wiki page in trac is also changed dynamically.
Instruction
- This plugin require trac 0.10.x.
If you use trac 0.9.x, please update it. And I’m sorry, currently this code doesn’t support trac 0.11.x because the plugin and wikimacro structure will be changed.
Download follow Plugin file and put it into plugin path:
/path/to/trac/root/plugins
Restart trac server(or apache web server if you use mod_python)
- Create a new wiki page or edit current wiki page
Place the “InsertSource” wikimacro:
[[IncludeSource(/path/to/wiki-source-file/under/subversion)]]
Save or preview
You have a typo in the text above. The example should be:
[[IncludeSource(/path/to/wiki-source-file/under/subversion)]]
Thank you for pointing my miss type. I fixed it up.
I'm not sure what this plugin does.
Does it insert the file in the current page, or does it take the file as the entire content of the current page.
An example would be good to see.
Hi, SW
This plugin insert the file as wiki source in the page on which '[[IncludeSource()]]' macro placed.
It Just dynamically replace the macro code to the content of file placed in SVN repo.
Hi,
Your macro is almost what I need. The only missing feature is the ability to specify start-line and end-line parameters.
Is it hard to do?
Actually I plan to use it to testbed a simple documentation mechanism for my project.
Looking forward to read from you,
Regards,
Candide
I just posted a blog about what I intend to do. I would love to have your comments about it.
great !!! I needed it for the piwik trac :) thanks
http://dev.piwik.org/trac/wiki/API
when adding in your file the processors calls such as
{{{
#!php
for example you can even include file contents with sytax coloring :-)
Hi Yoshimasa, I just posted an updated version of this with a few new features (like the start/end numbering) on the Trac MacroBazaar site.
http://trac.edgewall.org/wiki/MacroBazaar#IncludeSource
Hello, Chris. I checked your work for this tiny macro and it seems enough cool for us to use as an alternative of this macro :-)
please see my ticket about [[includetag('trunk/foo.cpp', 'tag1')]]
http://trac-hacks.org/ticket/2861
piwik mentioned that this plugin could be used in tandem with processor calls to format code, but I can't get the formatting processor to work. Can someone post a sample of using a formatter with the includesource plugin?