| 142 | |
| 143 | I 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 | |
| 145 | From the macro doc: |
| 146 | |
| 147 | Examples: |
| 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 | |
| 163 | Note 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 |