| 1 | [[PageOutline(2-5,Contents,pullout)]] |
| 2 | |
| 3 | = IncludeAttachment - embed the text of an attachment |
| 4 | |
| 5 | == Description |
| 6 | |
| 7 | 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. |
| 8 | |
| 9 | == Examples |
| 10 | |
| 11 | Include the attachment named `attachment.txt` of the `MyPage` wiki page: |
| 12 | |
| 13 | {{{ |
| 14 | IncludeAttachment(wiki:MyPage:attachment.txt) |
| 15 | }}} |
| 16 | |
| 17 | Include a source file from a ticket attachment: |
| 18 | |
| 19 | {{{ |
| 20 | IncludeAttachment(ticket:42:somefile.c) |
| 21 | }}} |
| 22 | |
| 23 | == Permissions |
| 24 | |
| 25 | The user must have the `ATTACHMENT_VIEW` on the attachment permission to be able to include it using this macro. |
| 26 | |
| 27 | |
| 28 | == !Bugs/Feature Requests |
| 29 | |
| 30 | Existing bugs and feature requests for IncludeAttachmentMacro are |
| 31 | [report:9?COMPONENT=IncludeAttachmentMacro here]. |
| 32 | |
| 33 | If you have any issues, create a |
| 34 | [/newticket?component=IncludeAttachmentMacro new ticket]. |
| 35 | |
| 36 | [[TicketQuery(component=IncludeAttachmentMacro&group=type,format=progress)]] |
| 37 | |
| 38 | == Download |
| 39 | |
| 40 | Download the zipped source from [export:includeattachmentmacro here]. |
| 41 | |
| 42 | == Source |
| 43 | |
| 44 | You can check out IncludeAttachmentMacro from [http://trac-hacks.org/svn/includeattachmentmacro here] using Subversion, or [source:includeattachmentmacro browse the source] with Trac. |
| 45 | |
| 46 | == Installation |
| 47 | |
| 48 | General instructions on installing Trac plugins can be found on the [TracPlugins#InstallingaTracplugin TracPlugins] page. |
| 49 | |
| 50 | == Recent Changes |
| 51 | |
| 52 | [[ChangeLog(includeattachmentmacro, 3)]] |
| 53 | |
| 54 | == !Author/Contributors |
| 55 | |
| 56 | **Author:** [wiki:jesrui] [[BR]] |
| 57 | **Maintainer:** [[Maintainer]] [[BR]] |
| 58 | **Contributors:** |