Version 6 (modified by figaro, 3 years ago) (diff)

Cosmetic changes

Partial includes of files in wiki pages


This is a modified version of the IncludeSource macro to allow for partial includes of files in Trac wiki pages.

This was originally done as a modification to the IncludeSource macro, but has been brought forward to Trac version 0.11.

Note that the macro in the file is still named IncludeSource because it provides the existing functionality, but titled differently to not conflict with the original. If people like this, it can be merged into the original IncludeSource to minimize confusion.

Bugs/Feature Requests

Existing bugs and feature requests for IncludeSourcePartialPlugin are here.

If you have any issues, create a new ticket.


8 / 8


2 / 4


Download the zipped source from here.


You can check out IncludeSourcePartialPlugin from here using Subversion, or browse the source with Trac.


General instructions on installing Trac plugins can be found on the TracPlugins page.


In your trac.ini file, edit the components section to add the entry as follows:

includesource.* = enabled


# include entire file

# includes line 20-50 inclusive
[[IncludeSource(trunk/proj/, start=20, end=50)]]

# includes last 30 lines of file at revision 1200
[[IncludeSource(trunk/proj/, start=-30, rev=1200)]]

# include entire file but formatted plain
[[IncludeSource(trunk/proj/, mimetype=text/plain)]]

Recent Changes

15931 by rjollos on 2016-10-19 17:07:30
0.4: Pass rev as parameter

Fixes a regression in r15745.

Patch by ebouaziz@…

Fixes #6009.

15745 by rjollos on 2016-09-02 01:36:04
0.3: Properly construct the href

Patch by ichael-dev@….

Fixes #6009.

15744 by rjollos on 2016-09-02 00:56:21
0.2: Fix ImportError due to missing

Fixes #12858.



Author: chrisheller
Maintainer: Chris Heller