[[PageOutline(2-5,Contents,pullout)]] = Export wiki pages as OpenDocument (ODT) == Description This plugin can convert a wiki page to an [http://en.wikipedia.org/wiki/Opendocument OpenDocument] Text file (ODT). The file can be opened with any compatible office suite, such as !OpenOffice, KOffice, IBM Symphony, etc. Currently, it has only been tested with !OpenOffice. The XSLT stylesheets come from the [http://xhtml2odt.org XHTML2ODT] project. == Bugs/Feature Requests Existing bugs and feature requests for OdtExportPlugin are [report:9?COMPONENT=OdtExportPlugin here]. If you have any issues, create a [/newticket?component=OdtExportPlugin new ticket]. [[TicketQuery(component=OdtExportPlugin&group=type,format=progress)]] == Download {{{#!html Flattr this }}} Download the zipped source from [export:odtexportplugin here]. == Source You can check out OdtExportPlugin from [/svn/odtexportplugin here] using Subversion, or [source:odtexportplugin browse the source] with Trac. == Installation Refer to the [trac:TracPlugins Trac plugin documentation] for details on how to build and install plugins and macros. You will probably have to enable the plugin by editing the `components` section of your `trac.ini` file: {{{#!ini [components] odtexport.* = enabled }}} After installing, a new alternative format should appear on the bottom of each wiki page, next to the "Plain Text" link. == Configuration In `trac.ini` you can set a few options : * '''get_remote_images''' (boolean, defaults to `true`) : whether the plugin should download the remote images. * '''replace_keyword''' (string, defaults to `TRAC-ODT-INSERT`) : the string in the ODT template file to replace with the wiki page content. This keyword ''must'' be unstyled and alone on its own line. If not present, the wiki content will be appended to the template. * '''cut_start_keyword''' (string, defaults to `TRAC-ODT-CUT-START`) and '''cut_stop_keyword''' (string, defaults to `TRAC-ODT-CUT-STOP`) : the text between these strings in the ODT template will be removed. See note below for the reason for these tags. * '''dpi''' (integer, defaults to `96`) : the screen DPI. * '''img_default_width''' (string, defaults to `8cm`) : the width of an exported image when the plugin can't compute it. * '''img_default_height''' (string, defaults to `6cm`) : the height of an exported image when the plugin can't compute it. * '''remove_macros''' (list, defaults to `PageOutline, TracGuideToc, TOC`) : the macros which will be removed on export. This is mainly because the table of contents should be handled in the ODT directly, not by generating a list of links. Warning, if these macros are in a sub-page included by the IncludeMacro (or similar), they will not be removed. In the specific case of IncludeMacro however, there is a [ticket:9035 patch available] to fix that. Those options must be placed under a `[odtexport]` section in the `trac.ini` file: {{{#!ini [odtexport] get_remote_images = False replace_keyword = REPLACE_ME }}} === About the `TRAC-ODT-CUT-START` and `TRAC-ODT-CUT-STOP` tags In an ODT file, the only styles that will be saved are the styles which are applied to some content in the document. If you want to create an empty ODT document for this plugin, and still want to define styles which will be applied to the wiki content, you have to write some dummy text, apply the styles to this text, and surround the text in the `TRAC-ODT-CUT-START` and `TRAC-ODT-CUT-STOP` tags. This way, the styles will be retained in the ODT file, but the dummy text will be removed on export. === Choosing a template The default template is named `wikipage.odt`. You can use a custom template by creating a file with this name and putting it in the `templates` directory of your Trac instance. This template will be used by default for all the pages. You can also create other ODT files to be used as templates, and put them in the same directory. Then you can use a special macro in the wiki page to choose the template. This macro is `OdtTemplate` and can be used as such: `[[OdtTemplate(my_other_template)]]`. The `.odt` suffix will be appended, don't put it in the macro. Finally, you can attach the template to the page, and use the `OdtTemplate` macro to select it. The order of preference when looking for the template file is: 1. in the page's attachments 1. in the Trac instance's `templates` directory 1. in the OdtExportPlugin's `templates` directory The first preference that is found is used. == Example Once installed, a new entry shows up below the ''Download in other formats'' section at the end of the page. Click and save to disk, and open with a compatible office suite such as !OpenOffice. == Recent Changes [[ChangeLog(odtexportplugin, 3)]] == Author/Contributors '''Author:''' [wiki:abompard Aurélien Bompard] [[BR]] '''Maintainer:''' [[Maintainer]] [[BR]] '''Contributors:'''