Display the text of an attachment


This macro embeds the contents of an attachment in a wiki-formatted text, for example a wiki page or a ticket. The text of the attachment is syntax-highlighted according to its MIME type. Currently only attachments of mime types starting with text/ are accepted.

To include the attachment named attachment.txt of the MyPage wiki page:


To include a source file from a ticket attachment:


The user must have the ATTACHMENT_VIEW permission on the attachment to be able to include it using this macro.

Bugs/Feature Requests

Existing bugs and feature requests for IncludeAttachmentMacro are here.

If you have any issues, create a new ticket.


1 / 1


Download the zipped source from here.


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


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

Change to the directory where you unpacked or checked out the sources and generate the .egg file:

$ cd includeattachmentmacro/trunk
$ python bdist_egg

Copy the .egg file to the plugins directory of your Trac environment:

$ cp dist/IncludeAttachment-0.1-py2.7.egg /path/to/trac/env/plugins

Enable the plugin in the trac configuration file /path/to/trac/env/conf/trac.ini:

includeattachment.* = enabled

Restart your web server to finish the installation of the macro.

Recent Changes

14768 by jesrui on 2015-06-27 22:02:10
add license

fixes #12419

14767 by jesrui on 2015-06-27 15:55:46
clean up
14766 by jesrui on 2015-06-27 15:34:36
initial commit


Author: jesrui
Maintainer: jesrui

Last modified 6 years ago Last modified on Aug 8, 2018, 9:20:12 PM