Edgewall Software

Changes between Version 222 and Version 223 of MacroBazaar


Ignore:
Timestamp:
Mar 10, 2008, 9:56:11 AM (16 years ago)
Author:
chris.heller
Comment:

Added information about updated version of IncludeSource

Legend:

Unmodified
Added
Removed
Modified
  • MacroBazaar

    v222 v223  
    140140[[BR]]''Download:'' http://niw.at/articles/2006/12/16/include-source-wiki-macro-for-trac
    141141[[BR]]''By:'' niw    --    ''Ver:'' = 0.10.x
     142
     143I have attached a modified version of the IncludeSource macro here. It is based on niw's version (linked above), buts adds a few new features, such as line numbering with links (just like the regular Trac browser pages), along with support for including line ranges and targeting specific revisions.
     144
     145From the macro doc:
     146
     147Examples:
     148{{{
     149# include entire file
     150[[IncludeSource(trunk/proj/file.py)]]
     151
     152# includes line 20-50 inclusive
     153[[IncludeSource(trunk/proj/file.py, start=20, end=50)]]
     154
     155# includes last 30 lines of file at revision 1200
     156[[IncludeSource(trunk/proj/file.py, start=-30, rev=1200)]]
     157
     158# include entire file but formatted plain
     159[[IncludeSource(trunk/proj/file.py, mimetype=text/plain)]]
     160
     161}}}
     162
     163Note that it currently has a bug with calling the macro twice in the same page. The source has additional information about where this happens. It seems to be related to apr pool stuff in the subversion python bindings.
     164
     165[[BR]]''By:'' chris.heller    --    ''Ver:'' = 0.10.x
    142166
    143167[wiki:MacroBazaar#Categories (categories)]