wiki:IncludeSourcePartialPlugin

Partial includes of files in wiki pages

Description

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.

defect

5 / 7

enhancement

2 / 4

Download

Download the zipped source from here.

Source

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

Installation

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

Configuration

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

[components]
includesource.* = enabled

Example

# include entire file
[[IncludeSource(trunk/proj/file.py)]]

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

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

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

Recent Changes

5481 by chrisheller on 2009-04-04 03:41:33
Close ticket:4346
5438 by chrisheller on 2009-03-31 08:09:49
Close ticket:4317
5437 by chrisheller on 2009-03-31 07:56:35
Close ticket:4433
(more)

Author/Contributors

Author: chrisheller
Maintainer: Chris Heller
Contributors:

Last modified 6 months ago Last modified on Nov 4, 2015, 11:55:08 AM