[[PageOutline(2-5,Contents,pullout)]] = IncludeAttachment - embed the text of an attachment == Description This macro embeds the contents of an attachment in a wiki-formated text (e.g. 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. == Examples Include the attachment named `attachment.txt` of the `MyPage` wiki page: {{{ IncludeAttachment(wiki:MyPage:attachment.txt) }}} Include a source file from a ticket attachment: {{{ IncludeAttachment(ticket:42:somefile.c) }}} == Permissions 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 [report:9?COMPONENT=IncludeAttachmentMacro here]. If you have any issues, create a [/newticket?component=IncludeAttachmentMacro new ticket]. [[TicketQuery(component=IncludeAttachmentMacro&group=type,format=progress)]] == Download Download the zipped source from [export:includeattachmentmacro here]. == Source You can check out IncludeAttachmentMacro from [/svn/includeattachmentmacro here] using Subversion, or [source:includeattachmentmacro browse the source] with Trac. == Installation General instructions on installing Trac plugins can be found on the [TracPlugins#InstallingaTracplugin TracPlugins] page. Change to the directory where you unpacked or checked out the sources and generate the .egg file: {{{ $ cd includeattachmentmacro/trunk $ python setup.py 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`): {{{ [components] includeattachment.* = enabled }}} Restart your web server to finish the installation of the macro. == Recent Changes [[ChangeLog(includeattachmentmacro, 3)]] == !Author/Contributors **Author:** [wiki:jesrui] [[BR]] **Maintainer:** [[Maintainer]] [[BR]] **Contributors:**