Version 4 (modified by Noah Kantrowitz, 12 years ago) (diff)


Include external resources in a wiki page.


This macro lets you include things into wiki pages.

Currently supported sources are:

  • HTTP - http: and https:
  • FTP - ftp:
  • Wiki pages - wiki:
  • Repository files - source:

An optional second argument lets you force the output MIME type to something specific, but most things should have sane defaults.

For URL includes (HTTP and FTP) you need the permission INCLUDE_URL. For other internal resources you need the normal Trac permission to access it.

Bugs/Feature Requests

Existing bugs and feature requests for IncludeMacro are here.

If you have any issues, create a new ticket.


Download the zipped source from [download:includemacro here].


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


Include Google on a page:


Include a wiki-formatted file from the repository:

[[Include(source:trunk/my_file.txt, text/x-trac-wiki)]]

Recent Changes

17709 by ttressieres on 2020-04-29 19:50:27
include a section of source file, accept 3 named parameters "start", "end", "lineno" (close #12729)
17698 by rjollos on 2020-04-24 18:27:36
TracIncludeMacro 3.2.0dev: Remove Trac 0.11 compatibility code

The macro supports Trac >= 1.0.

Refs #12729.

17157 by rjollos on 2018-04-25 00:13:15
TracIncludeMacro 3.2.0dev: Fix regression in r15552

The regression prevented specifying the mimetype
when rendering a file from the repository.

Closes #4004, Refs #12778.



Author: coderanger